diff --git a/request.go b/request.go index 63bf0f1..726be76 100644 --- a/request.go +++ b/request.go @@ -82,13 +82,16 @@ func Request(ctx context.Context, respStruct interface{}, opts RequestOpts) (*ht } func SilentProxy(ctx context.Context, w http.ResponseWriter, resp *http.Response) { - w.Header().Set("Content-Type", "application/json") - for key, valueSlice := range resp.Header { for _, v := range valueSlice { w.Header().Add(key, v) } } + + if w.Header().Get("Content-Type") == "" { + w.Header().Set("Content-Type", "application/json") + } + w.WriteHeader(resp.StatusCode) if resp.Body == nil {