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

Issue 53290044: code review 53290044: net/http: don't allow Content-Type or body on 204 and 1xx (Closed)

Can't Edit
Can't Publish+Mail
Start Review
Created:
10 years, 2 months ago by bradfitz
Modified:
10 years, 2 months ago
Reviewers:
r
CC:
golang-codereviews, r
Visibility:
Public.

Description

net/http: don't allow Content-Type or body on 204 and 1xx Status codes 204, 304, and 1xx don't allow bodies. We already had a function for this, but we were hard-coding just 304 (StatusNotModified) in a few places. Use the function instead, and flesh out tests for all codes. Fixes Issue 6685

Patch Set 1 #

Patch Set 2 : diff -r 57cda04cc69d https://go.googlecode.com/hg/ #

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

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

Unified diffs Side-by-side diffs Delta from patch set Stats (+34 lines, -29 lines) Patch
M src/pkg/net/http/serve_test.go View 1 1 chunk +29 lines, -24 lines 0 comments Download
M src/pkg/net/http/server.go View 1 5 chunks +5 lines, -5 lines 0 comments Download

Messages

Total messages: 3
bradfitz
Hello golang-codereviews@googlegroups.com, I'd like you to review this change to https://go.googlecode.com/hg/
10 years, 2 months ago (2014-01-16 19:34:53 UTC) #1
r
LGTM
10 years, 2 months ago (2014-01-16 19:41:58 UTC) #2
bradfitz
10 years, 2 months ago (2014-01-16 19:43:58 UTC) #3
*** Submitted as https://code.google.com/p/go/source/detail?r=902dc062bff8 ***

net/http: don't allow Content-Type or body on 204 and 1xx

Status codes 204, 304, and 1xx don't allow bodies. We already
had a function for this, but we were hard-coding just 304
(StatusNotModified) in a few places.  Use the function
instead, and flesh out tests for all codes.

Fixes Issue 6685

R=golang-codereviews, r
CC=golang-codereviews
https://codereview.appspot.com/53290044
Sign in to reply to this message.

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