watchdog - Write out headers with underscores
@@ -194,9 +194,10 @@ func getAdditionalEnvs(config *WatchdogConfig, r *http.Request, method string) [
if config.cgiHeaders {
envs = os.Environ()
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, fmt.Sprintf("Http_Method=%s", method))
if len(r.URL.RawQuery) > 0 {
