Skip to content

Commit

Permalink
Datagateway forward response headers (#926)
Browse files Browse the repository at this point in the history
  • Loading branch information
Vincent Petry authored Jul 1, 2020
1 parent 5a4b594 commit 2f6cc60
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions internal/http/services/datagateway/datagateway.go
Original file line number Diff line number Diff line change
Expand Up @@ -191,6 +191,8 @@ func (s *svc) doHead(w http.ResponseWriter, r *http.Request) {
}
defer httpRes.Body.Close()

copyHeader(w.Header(), httpRes.Header)

if httpRes.StatusCode != http.StatusOK {
w.WriteHeader(httpRes.StatusCode)
return
Expand Down Expand Up @@ -234,6 +236,7 @@ func (s *svc) doGet(w http.ResponseWriter, r *http.Request) {
}
defer httpRes.Body.Close()

copyHeader(w.Header(), httpRes.Header)
if httpRes.StatusCode != http.StatusOK {
w.WriteHeader(httpRes.StatusCode)
return
Expand Down Expand Up @@ -293,6 +296,7 @@ func (s *svc) doPut(w http.ResponseWriter, r *http.Request) {
}
defer httpRes.Body.Close()

copyHeader(w.Header(), httpRes.Header)
if httpRes.StatusCode != http.StatusOK {
w.WriteHeader(httpRes.StatusCode)
return
Expand Down

0 comments on commit 2f6cc60

Please sign in to comment.