Forward path and query string through proxy

Signed-off-by: Alex Ellis <alexellis2@gmail.com>
This commit is contained in:
Alex Ellis
2017-10-10 08:22:12 +01:00
parent 8ae81dad01
commit dde98eb582
4 changed files with 125 additions and 7 deletions

View File

@ -201,10 +201,20 @@ func getAdditionalEnvs(config *WatchdogConfig, r *http.Request, method string) [
envs = append(envs, fmt.Sprintf("Http_Method=%s", method))
log.Println(r.URL.String())
if len(r.URL.String()) > 0 {
envs = append(envs, fmt.Sprintf("Http_Query=%s", r.URL.String()))
if config.writeDebug {
log.Println("Query ", r.URL.RawQuery)
}
if len(r.URL.RawQuery) > 0 {
envs = append(envs, fmt.Sprintf("Http_Query=%s", r.URL.RawQuery))
}
if config.writeDebug {
log.Println("Path ", r.URL.Path)
}
if len(r.URL.Path) > 0 {
envs = append(envs, fmt.Sprintf("Http_Path=%s", r.URL.Path))
}
}
return envs