From 3c985840f1b394ca9ec43412d086ea9ca6cd1ddb Mon Sep 17 00:00:00 2001 From: Robert Newson Date: Tue, 24 Aug 2010 09:43:47 +0000 Subject: return 400 Bad Request for unparseable range request. git-svn-id: https://svn.apache.org/repos/asf/couchdb/trunk@988450 13f79535-47bb-0310-9956-ffa450edef68 --- share/www/script/test/attachment_ranges.js | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'share') diff --git a/share/www/script/test/attachment_ranges.js b/share/www/script/test/attachment_ranges.js index 65c1f475..aa5edd38 100644 --- a/share/www/script/test/attachment_ranges.js +++ b/share/www/script/test/attachment_ranges.js @@ -52,6 +52,14 @@ couchTests.attachment_ranges = function(debug) { TEquals("This is a base64 encoded text", xhr.responseText); TEquals("29", xhr.getResponseHeader("Content-Length")); + // Badly formed range header is a 400. + var xhr = CouchDB.request("GET", "/test_suite_db/bin_doc/foo.txt", { + headers: { + "Range": "bytes:0-" + } + }); + TEquals(400, xhr.status); + // Fetch the end of an entity without an end offset is a 206. var xhr = CouchDB.request("GET", "/test_suite_db/bin_doc/foo.txt", { headers: { -- cgit v1.2.3