Match content-type of incoming request. Fix for Alexa.

This commit is contained in:
Alex
2017-01-28 12:26:30 +00:00
parent b9838291b2
commit 52266a6741
13 changed files with 161 additions and 61 deletions

View File

@ -50,6 +50,10 @@ func makeRequestHandler(config *WatchdogConfig) func(http.ResponseWriter, *http.
os.Stdout.Write(out)
}
// Match header for strict services
if r.Header.Get("Content-Type") == "application/json" {
w.Header().Set("Content-Type", "application/json")
}
w.WriteHeader(200)
w.Write(out)
} else {