Changeset 202909 in webkit


Ignore:
Timestamp:
Jul 7, 2016 9:03:18 AM (8 years ago)
Author:
commit-queue@webkit.org
Message:

[Fetch API] Response.redirect should throw a RangeError in case of bad status code
https://bugs.webkit.org/show_bug.cgi?id=159507

Patch by Youenn Fablet <youenn@apple.com> on 2016-07-07
Reviewed by Alex Christensen.

LayoutTests/imported/w3c:

  • web-platform-tests/fetch/api/response/response-static-redirect-expected.txt:

Source/WebCore:

Covered by rebased test.

  • Modules/fetch/FetchResponse.cpp:

(WebCore::FetchResponse::redirect): Throw a RangeError in case of bad status.

Location:
trunk
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/imported/w3c/ChangeLog

    r202895 r202909  
     12016-07-07  Youenn Fablet  <youenn@apple.com>
     2
     3        [Fetch API] Response.redirect should throw a RangeError in case of bad status code
     4        https://bugs.webkit.org/show_bug.cgi?id=159507
     5
     6        Reviewed by Alex Christensen.
     7
     8        * web-platform-tests/fetch/api/response/response-static-redirect-expected.txt:
     9
    1102016-07-06  Chris Dumez  <cdumez@apple.com>
    211
  • trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/api/response/response-static-redirect-expected.txt

    r197162 r202909  
    77PASS Check response returned by static method redirect(), status = 308
    88PASS Check error returned when giving invalid url to redirect()
    9 FAIL Check error returned when giving invalid status to redirect(), status = 200 assert_throws: Expect RangeError exception function "function () { Response.redirect(url, invalidStatus); }" threw object "TypeError: Type error" ("TypeError") expected object "RangeError" ("RangeError")
    10 FAIL Check error returned when giving invalid status to redirect(), status = 309 assert_throws: Expect RangeError exception function "function () { Response.redirect(url, invalidStatus); }" threw object "TypeError: Type error" ("TypeError") expected object "RangeError" ("RangeError")
    11 FAIL Check error returned when giving invalid status to redirect(), status = 400 assert_throws: Expect RangeError exception function "function () { Response.redirect(url, invalidStatus); }" threw object "TypeError: Type error" ("TypeError") expected object "RangeError" ("RangeError")
    12 FAIL Check error returned when giving invalid status to redirect(), status = 500 assert_throws: Expect RangeError exception function "function () { Response.redirect(url, invalidStatus); }" threw object "TypeError: Type error" ("TypeError") expected object "RangeError" ("RangeError")
     9PASS Check error returned when giving invalid status to redirect(), status = 200
     10PASS Check error returned when giving invalid status to redirect(), status = 309
     11PASS Check error returned when giving invalid status to redirect(), status = 400
     12PASS Check error returned when giving invalid status to redirect(), status = 500
    1313
  • trunk/Source/WebCore/ChangeLog

    r202908 r202909  
     12016-07-07  Youenn Fablet  <youenn@apple.com>
     2
     3        [Fetch API] Response.redirect should throw a RangeError in case of bad status code
     4        https://bugs.webkit.org/show_bug.cgi?id=159507
     5
     6        Reviewed by Alex Christensen.
     7
     8        Covered by rebased test.
     9
     10        * Modules/fetch/FetchResponse.cpp:
     11        (WebCore::FetchResponse::redirect): Throw a RangeError in case of bad status.
     12
    1132016-07-05  Jer Noble  <jer.noble@apple.com>
    214
  • trunk/Source/WebCore/Modules/fetch/FetchResponse.cpp

    r201324 r202909  
    6666    }
    6767    if (!isRedirectStatus(status)) {
    68         ec = TypeError;
     68        ec = RangeError;
    6969        return nullptr;
    7070    }
Note: See TracChangeset for help on using the changeset viewer.