mirror of
https://github.com/openfaas/faas.git
synced 2025-06-09 00:36:46 +00:00
watchdog - Write out headers with underscores
Signed-off-by: Alex <alexellis2@gmail.com>
This commit is contained in:
parent
77f63be084
commit
6d436c576c
@ -150,10 +150,10 @@ func pipeRequest(config *WatchdogConfig, w http.ResponseWriter, r *http.Request,
|
|||||||
w.WriteHeader(http.StatusInternalServerError)
|
w.WriteHeader(http.StatusInternalServerError)
|
||||||
response := bytes.NewBufferString(err.Error())
|
response := bytes.NewBufferString(err.Error())
|
||||||
w.Write(response.Bytes())
|
w.Write(response.Bytes())
|
||||||
w.Write([]byte("\n"))
|
w.Write([]byte("\n"))
|
||||||
if len(out) > 0 {
|
if len(out) > 0 {
|
||||||
w.Write(out)
|
w.Write(out)
|
||||||
}
|
}
|
||||||
ri.headerWritten = true
|
ri.headerWritten = true
|
||||||
}
|
}
|
||||||
return
|
return
|
||||||
@ -194,9 +194,10 @@ func getAdditionalEnvs(config *WatchdogConfig, r *http.Request, method string) [
|
|||||||
if config.cgiHeaders {
|
if config.cgiHeaders {
|
||||||
envs = os.Environ()
|
envs = os.Environ()
|
||||||
for k, v := range r.Header {
|
for k, v := range r.Header {
|
||||||
kv := fmt.Sprintf("Http_%s=%s", k, v[0])
|
kv := fmt.Sprintf("Http_%s=%s", strings.Replace(k, "-", "_", -1), v[0])
|
||||||
envs = append(envs, kv)
|
envs = append(envs, kv)
|
||||||
}
|
}
|
||||||
|
|
||||||
envs = append(envs, fmt.Sprintf("Http_Method=%s", method))
|
envs = append(envs, fmt.Sprintf("Http_Method=%s", method))
|
||||||
|
|
||||||
if len(r.URL.RawQuery) > 0 {
|
if len(r.URL.RawQuery) > 0 {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user