]> Cypherpunks repositories - gostls13.git/commitdiff
net/http: remove a duplicated check
authorRobert Obryk <robryk@gmail.com>
Tue, 24 Jun 2014 00:38:17 +0000 (17:38 -0700)
committerBrad Fitzpatrick <bradfitz@golang.org>
Tue, 24 Jun 2014 00:38:17 +0000 (17:38 -0700)
The previous call to parseRange already checks whether
all the ranges start before the end of file.

LGTM=robert.hencke, bradfitz
R=golang-codereviews, robert.hencke, gobot, bradfitz
CC=golang-codereviews
https://golang.org/cl/91880044

src/pkg/net/http/fs.go

index 8576cf844a3ca412e4e1a6e296ef90bdea95699a..2c7ec53800644b3792fcabfd0fc062faf93321e2 100644 (file)
@@ -212,12 +212,6 @@ func serveContent(w ResponseWriter, r *Request, name string, modtime time.Time,
                        code = StatusPartialContent
                        w.Header().Set("Content-Range", ra.contentRange(size))
                case len(ranges) > 1:
-                       for _, ra := range ranges {
-                               if ra.start > size {
-                                       Error(w, err.Error(), StatusRequestedRangeNotSatisfiable)
-                                       return
-                               }
-                       }
                        sendSize = rangesMIMESize(ranges, ctype, size)
                        code = StatusPartialContent