Changeset 205081 in webkit


Ignore:
Timestamp:
Aug 27, 2016 11:43:32 AM (8 years ago)
Author:
commit-queue@webkit.org
Message:

[Fetch API] opaqueredirect responses should have their URL set to the original URL
https://bugs.webkit.org/show_bug.cgi?id=161194

Patch by Youenn Fablet <youenn@apple.com> on 2016-08-27
Reviewed by Sam Weinig.

LayoutTests/imported/w3c:

  • web-platform-tests/fetch/api/redirect/redirect-mode.html:
  • web-platform-tests/fetch/api/redirect/redirect-mode.js:

(redirectMode): Updating test to ease the computation of the absolute URL.

Source/WebCore:

Covered by updated tests.

  • loader/DocumentThreadableLoader.cpp:

(WebCore::DocumentThreadableLoader::didReceiveResponse):

  • loader/SubresourceLoader.cpp: Removing isNull ASSERT since we now set the response URL.

(WebCore::SubresourceLoader::willSendRequestInternal): Setting opaqueredirect response URL to the original URL.

Location:
trunk
Files:
6 edited

Legend:

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

    r205079 r205081  
     12016-08-27  Youenn Fablet  <youenn@apple.com>
     2
     3        [Fetch API] opaqueredirect responses should have their URL set to the original URL
     4        https://bugs.webkit.org/show_bug.cgi?id=161194
     5
     6        Reviewed by Sam Weinig.
     7
     8        * web-platform-tests/fetch/api/redirect/redirect-mode.html:
     9        * web-platform-tests/fetch/api/redirect/redirect-mode.js:
     10        (redirectMode): Updating test to ease the computation of the absolute URL.
     11
    1122016-08-27  Andreas Kling  <akling@apple.com>
    213
  • trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/api/redirect/redirect-mode.html

    r200195 r205081  
    1111  </head>
    1212  <body>
    13     <script src="../resources/utils.js"></script>
     13    <script src="../resources/get-host-info.sub.js"></script>
    1414    <script src="redirect-mode.js"></script>
    1515  </body>
  • trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/api/redirect/redirect-mode.js

    r200195 r205081  
    11if (this.document === undefined) {
    22  importScripts("/resources/testharness.js");
    3   importScripts("../resources/utils.js");
     3  importScripts("../resources/get-host-info.sub.js")
    44}
    55
     
    1919        assert_equals(resp.type, "opaqueredirect", "Response's type is opaqueredirect");
    2020        assert_equals(resp.statusText, "", "Response's statusText is \"\"");
     21        assert_equals(resp.url, url + urlParameters, "Response URL should be the original one");
    2122      });
    2223    if (redirectMode === "follow")
     
    2930}
    3031
    31 var redirUrl = RESOURCES_DIR + "redirect.py";
     32var redirUrl = get_host_info().HTTP_ORIGIN + "/fetch/api/resources/redirect.py";
    3233var locationUrl = "top.txt";
    3334
  • trunk/Source/WebCore/ChangeLog

    r205079 r205081  
     12016-08-27  Youenn Fablet  <youenn@apple.com>
     2
     3        [Fetch API] opaqueredirect responses should have their URL set to the original URL
     4        https://bugs.webkit.org/show_bug.cgi?id=161194
     5
     6        Reviewed by Sam Weinig.
     7
     8        Covered by updated tests.
     9
     10        * loader/DocumentThreadableLoader.cpp:
     11        (WebCore::DocumentThreadableLoader::didReceiveResponse):
     12        * loader/SubresourceLoader.cpp: Removing isNull ASSERT since we now set the response URL.
     13        (WebCore::SubresourceLoader::willSendRequestInternal): Setting opaqueredirect response URL to the original URL.
     14
    1152016-08-27  Andreas Kling  <akling@apple.com>
    216
  • trunk/Source/WebCore/loader/DocumentThreadableLoader.cpp

    r204795 r205081  
    285285        m_client->didReceiveResponse(identifier, ResourceResponse::filterResponse(response, tainting));
    286286    else {
    287         ASSERT(response.isNull() && response.type() == ResourceResponse::Type::Opaqueredirect);
     287        ASSERT(response.type() == ResourceResponse::Type::Opaqueredirect);
    288288        m_client->didReceiveResponse(identifier, response);
    289289    }
  • trunk/Source/WebCore/loader/SubresourceLoader.cpp

    r205062 r205081  
    183183
    184184            ResourceResponse opaqueRedirectedResponse;
     185            opaqueRedirectedResponse.setURL(redirectResponse.url());
    185186            opaqueRedirectedResponse.setType(ResourceResponse::Type::Opaqueredirect);
    186187            m_resource->responseReceived(opaqueRedirectedResponse);
Note: See TracChangeset for help on using the changeset viewer.