Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

content-length is incorrect when requested range.end is larger than the actual content-length #5

Closed
wants to merge 1 commit into from

2 participants

@mtsr

Fixed by taking the minimum of requested range.end and actual content-length (-1)

@tj
Owner
tj commented

test please :D

@mtsr

Ah, so this problem has been fixed since send was extracted. It's quite non-obvious, though, being done in the range-parser.

@mtsr mtsr closed this
@sebs sebs referenced this pull request from a commit in sebs/send
Sebastian Schürmann Fixing issue #5 35a742b
@getfatday getfatday referenced this pull request in gruntjs/grunt-contrib-livereload
Closed

40kb limit on html files #25

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Aug 8, 2012
  1. @mtsr

    Fixed incorrect content-length when requested range.end is larger tha…

    mtsr authored
    …n the actual content-length
This page is out of date. Refresh to see the latest.
Showing with 1 addition and 1 deletion.
  1. +1 −1  lib/send.js
View
2  lib/send.js
@@ -362,7 +362,7 @@ SendStream.prototype.send = function(path, stat){
// valid (syntactically invalid ranges are treated as a regular response)
if (-2 != ranges) {
options.start = ranges[0].start;
- options.end = ranges[0].end;
+ options.end = Math.min(ranges[0].end, stat.size - 1);
// Content-Range
len = options.end - options.start + 1;
Something went wrong with that request. Please try again.