Skip to content

Commit

Permalink
swarm/api/http: Don't force Content-Type where possible, let builtin …
Browse files Browse the repository at this point in the history
…sniffer work (ethersphere#527, ethersphere#944)
  • Loading branch information
nizsheanez committed Sep 23, 2018
1 parent e41ea4e commit 7c3c4c1
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions swarm/api/http/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -755,11 +755,9 @@ func (s *Server) HandleGet(w http.ResponseWriter, r *http.Request) {
case uri.Raw():
// allow the request to overwrite the content type using a query
// parameter
contentType := api.MimeOctetStream
if typ := r.URL.Query().Get("content_type"); typ != "" {
contentType = typ
w.Header().Set("Content-Type", typ)
}
w.Header().Set("Content-Type", contentType)
http.ServeContent(w, r, "", time.Now(), reader)
case uri.Hash():
w.Header().Set("Content-Type", "text/plain")
Expand Down

0 comments on commit 7c3c4c1

Please sign in to comment.