Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(544)

Issue 12117043: code review 12117043: net/http: don't MIME sniff if handler set an empty stri... (Closed)

Can't Edit
Can't Publish+Mail
Start Review
Created:
10 years, 9 months ago by bradfitz
Modified:
10 years, 7 months ago
Reviewers:
dsymonds, piatek
CC:
golang-dev
Visibility:
Public.

Description

net/http: don't MIME sniff if handler set an empty string Content-Type Fixes issue 5953

Patch Set 1 #

Patch Set 2 : diff -r 0532d70e7bc8 https://go.googlecode.com/hg/ #

Patch Set 3 : diff -r d656f46cfb72 https://go.googlecode.com/hg/ #

Patch Set 4 : diff -r b2f71fb7e959 https://go.googlecode.com/hg/ #

Total comments: 1
Unified diffs Side-by-side diffs Delta from patch set Stats (+26 lines, -1 line) Patch
M src/pkg/net/http/server.go View 1 1 chunk +2 lines, -1 line 1 comment Download
M src/pkg/net/http/sniff_test.go View 1 2 chunks +24 lines, -0 lines 0 comments Download

Messages

Total messages: 7
bradfitz
Hello golang-dev@googlegroups.com, I'd like you to review this change to https://go.googlecode.com/hg/
10 years, 9 months ago (2013-07-31 22:37:05 UTC) #1
dsymonds
should the output have *no* Content-Type header instead of "Content-Type: \r\n"?
10 years, 9 months ago (2013-08-01 00:27:27 UTC) #2
bradfitz
No. That would happen with []string{} but not with an explicit empty string. That's not ...
10 years, 9 months ago (2013-08-01 00:29:17 UTC) #3
dsymonds
LGTM fair enough
10 years, 9 months ago (2013-08-01 00:30:55 UTC) #4
bradfitz
*** Submitted as https://code.google.com/p/go/source/detail?r=c8247d0380cd *** net/http: don't MIME sniff if handler set an empty string ...
10 years, 9 months ago (2013-08-01 06:38:36 UTC) #5
piatek
https://codereview.appspot.com/12117043/diff/8001/src/pkg/net/http/server.go File src/pkg/net/http/server.go (right): https://codereview.appspot.com/12117043/diff/8001/src/pkg/net/http/server.go#newcode341 src/pkg/net/http/server.go:341: return !w.cw.wroteHeader && w.handlerHeader.Get("Content-Type") == "" && w.written < ...
10 years, 7 months ago (2013-10-04 23:38:01 UTC) #6
dsymonds
10 years, 7 months ago (2013-10-05 03:46:15 UTC) #7
Message was sent while issue was closed.
On 2013/10/04 23:38:01, piatek wrote:
> https://codereview.appspot.com/12117043/diff/8001/src/pkg/net/http/server.go
> File src/pkg/net/http/server.go (right):
> 
>
https://codereview.appspot.com/12117043/diff/8001/src/pkg/net/http/server.go#...
> src/pkg/net/http/server.go:341: return !w.cw.wroteHeader &&
> w.handlerHeader.Get("Content-Type") == "" && w.written < sniffLen
> I realize I'm a few months late to the game, but shouldn't the check be
> duplicated here to prevent buffering for sniffing that will not occur?

Probably. Want to send a CL?
Sign in to reply to this message.

Powered by Google App Engine
RSS Feeds Recent Issues | This issue
This is Rietveld f62528b