diff options
Diffstat (limited to 'workhorse/internal/dependencyproxy/dependencyproxy.go')
-rw-r--r-- | workhorse/internal/dependencyproxy/dependencyproxy.go | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/workhorse/internal/dependencyproxy/dependencyproxy.go b/workhorse/internal/dependencyproxy/dependencyproxy.go index b21600d5186..0bba2610d9e 100644 --- a/workhorse/internal/dependencyproxy/dependencyproxy.go +++ b/workhorse/internal/dependencyproxy/dependencyproxy.go @@ -67,6 +67,8 @@ func (p *Injector) Inject(w http.ResponseWriter, r *http.Request, sendData strin return } + w.Header().Set("Content-Length", dependencyResponse.Header.Get("Content-Length")) + teeReader := io.TeeReader(dependencyResponse.Body, w) saveFileRequest, err := http.NewRequestWithContext(r.Context(), "POST", r.URL.String()+"/upload", teeReader) if err != nil { @@ -75,8 +77,6 @@ func (p *Injector) Inject(w http.ResponseWriter, r *http.Request, sendData strin saveFileRequest.Header = helper.HeaderClone(r.Header) saveFileRequest.ContentLength = dependencyResponse.ContentLength - w.Header().Del("Content-Length") - nrw := &nullResponseWriter{header: make(http.Header)} p.uploadHandler.ServeHTTP(nrw, saveFileRequest) |