Skip to content
Snippets Groups Projects
Commit 6d5ae1af authored by Alex Ellis's avatar Alex Ellis
Browse files

Fix content type pass through


Signed-off-by: default avatarAlex Ellis <alexellis2@gmail.com>
parent 2e6af243
No related branches found
No related tags found
No related merge requests found
......@@ -168,9 +168,12 @@ func invokeService(w http.ResponseWriter, r *http.Request, metrics metrics.Metri
clientHeader := w.Header()
copyHeaders(&clientHeader, &response.Header)
// TODO: copyHeaders removes the need for this line - test removal.
// Match header for strict services
w.Header().Set("Content-Type", r.Header.Get("Content-Type"))
header := response.Header.Get("Content-Type")
if len(header) > 0 {
w.Header().Set("Content-Type", response.Header.Get("Content-Type"))
} else {
w.Header().Set("Content-Type", r.Header.Get("Content-Type"))
}
writeHead(service, metrics, http.StatusOK, w)
w.Write(responseBody)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment