Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: f8eec063afd9a4a16b29d2a0c800a1de7e1034a5
      
https://github.com/WebKit/WebKit/commit/f8eec063afd9a4a16b29d2a0c800a1de7e1034a5
  Author: Ahmad Saleem <[email protected]>
  Date:   2026-07-30 (Thu, 30 Jul 2026)

  Changed paths:
    A 
LayoutTests/imported/w3c/web-platform-tests/xhr/responseurl-after-abort.any-expected.txt
    A 
LayoutTests/imported/w3c/web-platform-tests/xhr/responseurl-after-abort.any.html
    A 
LayoutTests/imported/w3c/web-platform-tests/xhr/responseurl-after-abort.any.js
    A 
LayoutTests/imported/w3c/web-platform-tests/xhr/responseurl-after-abort.any.worker-expected.txt
    A 
LayoutTests/imported/w3c/web-platform-tests/xhr/responseurl-after-abort.any.worker.html
    M Source/WebCore/xml/XMLHttpRequest.cpp

  Log Message:
  -----------
  XMLHttpRequest.responseURL still returns the aborted request's URL after 
abort()
https://bugs.webkit.org/show_bug.cgi?id=320617
rdar://183587043

Reviewed by Chris Dumez.

XMLHttpRequest::abort() only called clearResponseBuffers(), which clears the
response body, decoder and cached document but leaves m_response -- and
therefore the response URL, status, status message and header list -- intact.

status(), statusText(), getResponseHeader() and getAllResponseHeaders() all
happen to hide the stale response because they bail out early when m_error is
set, but responseURL() has no such guard and reads m_response.url() directly.
So after abort() we reported status 0, empty statusText and empty headers,
while responseURL kept handing back the URL of the request that was just
aborted, in all three abort states (HEADERS_RECEIVED, LOADING and DONE).

Per https://xhr.spec.whatwg.org/#the-abort()-method, both the request error
steps (step 2) and step 3 set the response to a network error, and a network
error's URL is null, so responseURL must return the empty string. Call
clearResponse() instead, which resets m_response as well as the buffers.

Firefox and Chrome both return the empty string here.

Tests: imported/w3c/web-platform-tests/xhr/responseurl-after-abort.any.html
       
imported/w3c/web-platform-tests/xhr/responseurl-after-abort.any.worker.html

* 
LayoutTests/imported/w3c/web-platform-tests/xhr/responseurl-after-abort.any-expected.txt:
 Added.
* 
LayoutTests/imported/w3c/web-platform-tests/xhr/responseurl-after-abort.any.html:
 Added.
* 
LayoutTests/imported/w3c/web-platform-tests/xhr/responseurl-after-abort.any.js: 
Added.
(assertNetworkError):
(async_test.test.client.onreadystatechange.test.step_func):
(async_test.test.client.onloadend.test.step_func_done):
(async_test.test.client.onload.test.step_func_done):
(test):
* 
LayoutTests/imported/w3c/web-platform-tests/xhr/responseurl-after-abort.any.worker-expected.txt:
 Added.
* 
LayoutTests/imported/w3c/web-platform-tests/xhr/responseurl-after-abort.any.worker.html:
 Added.
* Source/WebCore/xml/XMLHttpRequest.cpp:
(WebCore::XMLHttpRequest::abort):

Canonical link: https://commits.webkit.org/318241@main



To unsubscribe from these emails, change your notification settings at 
https://github.com/WebKit/WebKit/settings/notifications

Reply via email to