Skip to content
Snippets Groups Projects
Commit fa5fbb80 authored by David Fifield's avatar David Fifield
Browse files

Set Content-Type: application/octet-stream in meek-server.

Even thought it takes up space in the header, it looks like Google and
Amazon try to sniff the type and add the header anyway if it is missing.
(They set "text/plain; charset=utf-8" for zero-length bodies and
"application/octet-stream" for non-zero bodies). So we might as well add
it preemptively.

https://trac.torproject.org/projects/tor/ticket/12778
parent 5b51cf7d
No related branches found
No related tags found
No related merge requests found
......@@ -164,6 +164,8 @@ func transact(session *Session, w http.ResponseWriter, req *http.Request) error
}
}
// log.Printf("read %d bytes from ORPort: %q", n, buf[:n])
// Set a Content-Type to prevent Go and the CDN from trying to guess.
w.Header().Set("Content-Type", "application/octet-stream")
n, err = w.Write(buf[:n])
if err != nil {
return errors.New(fmt.Sprintf("writing to response: %s", err))
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment