Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
G
golang
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
go
golang
Commits
732f2fa2
Commit
732f2fa2
authored
Mar 28, 2011
by
Russ Cox
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
http: avoid crash when asked for multiple file ranges
R=adg CC=golang-dev
https://golang.org/cl/4289076
parent
59a89268
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
1 deletion
+4
-1
fs.go
src/pkg/http/fs.go
+4
-1
No files found.
src/pkg/http/fs.go
View file @
732f2fa2
...
...
@@ -154,7 +154,10 @@ func serveFile(w ResponseWriter, r *Request, name string, redirect bool) {
// handle Content-Range header.
// TODO(adg): handle multiple ranges
ranges
,
err
:=
parseRange
(
r
.
Header
.
Get
(
"Range"
),
size
)
if
err
!=
nil
||
len
(
ranges
)
>
1
{
if
err
==
nil
&&
len
(
ranges
)
>
1
{
err
=
os
.
ErrorString
(
"multiple ranges not supported"
)
}
if
err
!=
nil
{
Error
(
w
,
err
.
String
(),
StatusRequestedRangeNotSatisfiable
)
return
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment