diff options
-rw-r--r-- | share/www/script/test/attachment_ranges.js | 6 | ||||
-rw-r--r-- | src/couchdb/couch_httpd_db.erl | 2 |
2 files changed, 4 insertions, 4 deletions
diff --git a/share/www/script/test/attachment_ranges.js b/share/www/script/test/attachment_ranges.js index aa5edd38..807a13c8 100644 --- a/share/www/script/test/attachment_ranges.js +++ b/share/www/script/test/attachment_ranges.js @@ -108,9 +108,9 @@ couchTests.attachment_ranges = function(debug) { } }); TEquals(206, xhr.status); - TEquals("text", xhr.responseText); - TEquals("4", xhr.getResponseHeader("Content-Length")); - TEquals("bytes 25-28/29", xhr.getResponseHeader("Content-Range")); + TEquals("ext", xhr.responseText); + TEquals("3", xhr.getResponseHeader("Content-Length")); + TEquals("bytes 26-28/29", xhr.getResponseHeader("Content-Range")); }; diff --git a/src/couchdb/couch_httpd_db.erl b/src/couchdb/couch_httpd_db.erl index 8ee6fc3f..0479c9c1 100644 --- a/src/couchdb/couch_httpd_db.erl +++ b/src/couchdb/couch_httpd_db.erl @@ -1096,7 +1096,7 @@ parse_ranges([], _Len, Acc) -> parse_ranges([{From,To}|Rest], Len, Acc) -> {From1, To1} = case {From, To} of {none, To} -> - {Len - To - 1, Len - 1}; + {Len - To, Len - 1}; {From, none} -> {From, Len - 1}; _ -> |