Chromium Code Reviews| Index: Source/modules/fetch/Response.cpp |
| diff --git a/Source/modules/fetch/Response.cpp b/Source/modules/fetch/Response.cpp |
| index 29c7c0de34933f6a711117f2692aea6a6a8abcba..e64e1b7a7b0ac51bc7c96894f1c3b87e3d2b5dff 100644 |
| --- a/Source/modules/fetch/Response.cpp |
| +++ b/Source/modules/fetch/Response.cpp |
| @@ -153,9 +153,12 @@ 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) { |
| + 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" |
|
hiroshige
2015/07/29 11:49:11
According to the latest spec,
- null body status c
shiva.jm
2015/07/30 09:10:42
Done.
|
| + if (status < 200 || status == 204 || status == 205 || status == 304 || 599 < status) { |
|
hiroshige
2015/07/29 11:49:11
Please define isNullBodyStatus() in the anonymous
shiva.jm
2015/07/30 09:10:42
Done.
|
| exceptionState.throwRangeError("Invalid status"); |
| return 0; |
| } |