Adds HTTP Host entry

Fixes: https://github.com/openfaas-incubator/of-watchdog/pull/24

Signed-off-by: Alex Ellis (VMware) <alexellis2@gmail.com>
This commit is contained in:
Alex Ellis (VMware)
2018-08-13 17:42:49 +01:00
parent 44ceb8da22
commit a4c867fd8f
2 changed files with 64 additions and 0 deletions

View File

@ -249,6 +249,10 @@ func getAdditionalEnvs(config *WatchdogConfig, r *http.Request, method string) [
envs = append(envs, fmt.Sprintf("Http_Path=%s", r.URL.Path))
}
if len(r.Host) > 0 {
envs = append(envs, fmt.Sprintf("Http_Host=%s", r.Host))
}
}
return envs