Index: Source/modules/fetch/Response.cpp |
diff --git a/Source/modules/fetch/Response.cpp b/Source/modules/fetch/Response.cpp |
index 29c7c0de34933f6a711117f2692aea6a6a8abcba..0307c8bbe8492645ba0eb8e7f5a308c14e1438bf 100644 |
--- a/Source/modules/fetch/Response.cpp |
+++ b/Source/modules/fetch/Response.cpp |
@@ -153,10 +153,13 @@ Response* Response::create(ExecutionContext* context, const BodyInit& body, cons |
Response* Response::create(ExecutionContext* context, Blob* body, const ResponseInit& responseInit, ExceptionState& exceptionState) |
{ |
- // "1. If |init|'s status member is not in the range 200 to 599, throw a |
- // RangeError." |
- if (responseInit.status < 200 || 599 < responseInit.status) { |
- exceptionState.throwRangeError("Invalid status"); |
+ unsigned short status = responseInit.status; |
+ |
+ // "1. If init's status member is either not in the range 200 to 599, inclusive, |
+ // or is a null body status, throw a RangeError. A null body status is 101, 204, 205, or 304, |
+ // spec link, See https://fetch.spec.whatwg.org/#null-body-status for details" |
+ if (status < 200 || status == 204 || status == 205 || status == 304 || 599 < status) { |
+ exceptionState.throwRangeError(ExceptionMessages::indexOutsideRange<unsigned>("status", status, 200, ExceptionMessages::InclusiveBound, 599, ExceptionMessages::InclusiveBound)); |
philipj_slow
2015/07/29 09:15:46
The exception message doesn't make sense with the
shiva.jm
2015/07/29 11:22:24
Done.
shiva.jm
2015/07/29 11:22:25
Done.
|
return 0; |
} |