Commit e2d44377 authored by Kirill Smelkov's avatar Kirill Smelkov

X Content-Type is detected automatically

parent 5be33684
Pipeline #127 failed with stage
......@@ -294,12 +294,12 @@ func emitBlob(w http.ResponseWriter, repopath string, refpath string) {
w.Header().Set("Content-Transfer-Encoding", "binary")
w.Header().Set("Content-Length", fmt.Sprintf("%d", size))
w.Header().Set("X-Content-Type-Options", "nosniff")
//w.Header().Set("Content-Type", "...") TODO image/jpeg...
// net/http sniffs stream and and automatically detects and sets
// Content-Type header. We do not have to do it ourselves
w.Header().Set("Cache-Control", "private") // Rails sets this for IE compatibility
w.Header().Set("ETag", fmt.Sprintf(`"%s"`, sha1))
//setRawHeaders(...) // TODO
w.WriteHeader(200) // Don't bother with HTTP 500 from this point on, just return
// XXX better use queryStdout instead of queryReader, but we could be
// holding some tail bytes in queryReader after chat phase
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment