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

Issue 163820043: code review 163820043: net/http: Fix Range off-by-one error

Can't Edit
Can't Publish+Mail
Start Review
Created:
9 years, 6 months ago by jeddenlea
Modified:
9 years, 4 months ago
Reviewers:
CC:
golang-codereviews, bradfitz
Visibility:
Public.

Description

net/http: Fix Range off-by-one error Given a file of size N, a request for "Range: bytes=N-*" should return a 416 [1]. Currently, it returns a 206 and a body of 0 bytes, with the illegal Content-Range of "bytes N-(N-1)/N" [2]. [1]: RFC 2616, sec 14.35.1: "If a syntactically valid byte-range-set includes at least one byte- range-spec whose first-byte-pos is less than the current length of the entity-body, or at least one suffix-byte-range-spec with a non- zero suffix-length, then the byte-range-set is satisfiable. Otherwise, the byte-range-set is unsatisfiable. If the byte-range-set is unsatisfiable, the server SHOULD return a response with a status of 416 (Requested range not satisfiable)." [2]: RFC 2616, sec 14.16: "A byte-content-range-spec with a byte-range-resp-spec whose last- byte-pos value is less than its first-byte-pos value, or whose instance-length value is less than or equal to its last-byte-pos value, is invalid. The recipient of an invalid byte-content-range- spec MUST ignore it and any content transferred along with it." Fixes issue 8988.

Patch Set 1 #

Patch Set 2 : diff -r 5db49b99612c356e35d4977d95ff4f464c2110bb https://code.google.com/p/go #

Patch Set 3 : diff -r 5db49b99612c356e35d4977d95ff4f464c2110bb https://code.google.com/p/go #

Total comments: 2

Patch Set 4 : diff -r 5db49b99612c356e35d4977d95ff4f464c2110bb https://code.google.com/p/go #

Patch Set 5 : diff -r 5db49b99612c356e35d4977d95ff4f464c2110bb https://code.google.com/p/go #

Unified diffs Side-by-side diffs Delta from patch set Stats (+13 lines, -5 lines) Patch
M src/net/http/fs.go View 1 1 chunk +1 line, -1 line 0 comments Download
M src/net/http/fs_test.go View 1 4 1 chunk +12 lines, -4 lines 0 comments Download

Messages

Total messages: 13
jeddenlea
Hello golang-codereviews@googlegroups.com (cc: golang-codereviews@googlegroups.com), I'd like you to review this change to https://code.google.com/p/go
9 years, 6 months ago (2014-10-23 19:45:14 UTC) #1
bradfitz
https://codereview.appspot.com/163820043/diff/40001/src/net/http/fs_test.go File src/net/http/fs_test.go (left): https://codereview.appspot.com/163820043/diff/40001/src/net/http/fs_test.go#oldcode53 src/net/http/fs_test.go:53: {r: "bytes=20-", code: StatusRequestedRangeNotSatisfiable}, please redo this file so ...
9 years, 6 months ago (2014-10-23 21:41:11 UTC) #2
jeddenlea
On 2014/10/23 21:41:11, bradfitz wrote: > https://codereview.appspot.com/163820043/diff/40001/src/net/http/fs_test.go > File src/net/http/fs_test.go (left): > > https://codereview.appspot.com/163820043/diff/40001/src/net/http/fs_test.go#oldcode53 > ...
9 years, 6 months ago (2014-10-23 22:01:40 UTC) #3
bradfitz
For each change, clean or fix. But not both. It obscures fixes. You can do ...
9 years, 6 months ago (2014-10-23 22:04:31 UTC) #4
bradfitz
https://codereview.appspot.com/163820043/diff/40001/src/net/http/fs_test.go File src/net/http/fs_test.go (left): https://codereview.appspot.com/163820043/diff/40001/src/net/http/fs_test.go#oldcode53 src/net/http/fs_test.go:53: {r: "bytes=20-", code: StatusRequestedRangeNotSatisfiable}, Okay, I've actually read these ...
9 years, 6 months ago (2014-10-23 22:22:55 UTC) #5
bradfitz
Have you guys submitted a corporate CLA for Fastly? On Thu, Oct 23, 2014 at ...
9 years, 6 months ago (2014-10-23 22:24:17 UTC) #6
jeddenlea
On 2014/10/23 22:24:17, bradfitz wrote: > Have you guys submitted a corporate CLA for Fastly? ...
9 years, 6 months ago (2014-10-23 22:28:43 UTC) #7
bradfitz
Size of patch doesn't matter I don't think. On Oct 23, 2014 3:28 PM, <jed@fastly.com> ...
9 years, 6 months ago (2014-10-23 22:32:54 UTC) #8
jeddenlea
Ok, I'll try to expedite that if it's necessary for you to accept this. I ...
9 years, 6 months ago (2014-10-23 22:51:26 UTC) #9
jeddenlea
Hey Brad, We finally submitted the agreement for Fastly. Max Sills can confirm. Thanks! -Jed ...
9 years, 6 months ago (2014-10-29 21:58:00 UTC) #10
bradfitz
Could you try submitting this again with the updated git + Gerrit contribution instructions? I'm ...
9 years, 4 months ago (2014-12-16 03:00:16 UTC) #11
jeddenlea
Doesn't seem to be working, at least not for fastly.com. I worked through the updated ...
9 years, 4 months ago (2014-12-16 08:51:02 UTC) #12
gobot
9 years, 4 months ago (2014-12-19 05:14:58 UTC) #13
R=close

To the author of this CL:

The Go project has moved to Gerrit Code Review.

If this CL should be continued, please see the latest version of
https://golang.org/doc/contribute.html for instructions on
how to set up Git and the Go project's Gerrit codereview plugin,
and then create a new change with your current code.

If there has been discussion on this CL, please give a link to it
(golang.org/cl/163820043 is best) in the description in your
new CL.

Thanks very much.
Sign in to reply to this message.

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