Skip to content

Commit f40cfa3

Browse files
committed
Add Content-Type and Content-Length headers in ServeHTTP response
1 parent 2e566f5 commit f40cfa3

1 file changed

Lines changed: 2 additions & 0 deletions

File tree

tee_response.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,8 @@ func (t *teeResponse) ServeHTTP(w http.ResponseWriter, r *http.Request) {
3232
defer rs.Close()
3333
name := path.Base(r.URL.Path)
3434
w.Header().Set("ETag", t.etag)
35+
w.Header().Set("Content-Type", "application/octet-stream")
36+
w.Header().Set("Content-Length", fmt.Sprint(size))
3537
http.ServeContent(w, r, name, t.fileInfo.ModTime(), rs)
3638
} else {
3739
rs := t.swmr.NewReader(0)

0 commit comments

Comments
 (0)