With service workers, the response URL might not be the same as the request URL. The response URL should be used.
With service workers, the response URL might not be the same as the request URL. The response URL (https://fetch.spec.whatwg.org/#concept-response-url) should be used. This affects xhr.responseURL and xhr.responseXML.URL (when the XHR response was a Document). Chrome Status: https://www.chromestatus.com/feature/5676711949631488 Spec notes: For xhr.responseURL: "The responseURL attribute must return the empty string if response’s url is null and its serialization with the exclude fragment flag set otherwise." https://xhr.spec.whatwg.org/#the-responseurl-attribute For xhr.responseXML.URL: "Set document’s URL to response’s url." https://xhr.spec.whatwg.org/#document-response
The following revision refers to this bug: https://chromium.googlesource.com/chromium/src.git/+/faa5b27047e84a1727c9303157b1f2208e554864 commit faa5b27047e84a1727c9303157b1f2208e554864 Author: Matt Falkenhagen <falken@chromium.org> Date: Wed Jan 16 22:50:10 2019 service worker: WPT: Add test for XHR responseURL. Bug: 915126 Change-Id: I2a81213e15a31c7d59ab9138a662b9f8d0a28ffe Reviewed-on: https://chromium-review.googlesource.com/c/1414556 Reviewed-by: Ben Kelly <wanderview@chromium.org> Commit-Queue: Matt Falkenhagen <falken@chromium.org> Cr-Commit-Position: refs/heads/master@{#623418} [add] https://crrev.com/faa5b27047e84a1727c9303157b1f2208e554864/third_party/blink/web_tests/external/wpt/service-workers/service-worker/resources/xhr-iframe.html [add] https://crrev.com/faa5b27047e84a1727c9303157b1f2208e554864/third_party/blink/web_tests/external/wpt/service-workers/service-worker/xhr-response-url.https-expected.txt [add] https://crrev.com/faa5b27047e84a1727c9303157b1f2208e554864/third_party/blink/web_tests/external/wpt/service-workers/service-worker/xhr-response-url.https.html
The following revision refers to this bug: https://chromium.googlesource.com/chromium/src.git/+/eebd14b2bd0c7c46c951884962a82f5f6a9a2913 commit eebd14b2bd0c7c46c951884962a82f5f6a9a2913 Author: Matt Falkenhagen <falken@chromium.org> Date: Thu Jan 17 02:41:10 2019 service worker: WPT: Add test for XHR Document's URL. Bug: 915126 Change-Id: I967a72b1e2317af4ddd0be1144f505ebb80948d8 Reviewed-on: https://chromium-review.googlesource.com/c/1415231 Commit-Queue: Matt Falkenhagen <falken@chromium.org> Reviewed-by: Ben Kelly <wanderview@chromium.org> Cr-Commit-Position: refs/heads/master@{#623528} [modify] https://crrev.com/eebd14b2bd0c7c46c951884962a82f5f6a9a2913/third_party/blink/web_tests/external/wpt/service-workers/service-worker/resources/xhr-iframe.html [modify] https://crrev.com/eebd14b2bd0c7c46c951884962a82f5f6a9a2913/third_party/blink/web_tests/external/wpt/service-workers/service-worker/xhr-response-url.https-expected.txt [modify] https://crrev.com/eebd14b2bd0c7c46c951884962a82f5f6a9a2913/third_party/blink/web_tests/external/wpt/service-workers/service-worker/xhr-response-url.https.html
The following revision refers to this bug: https://chromium.googlesource.com/chromium/src.git/+/9c34e04a9e3f0aae3661d2e63f2e3cfaa6236eda commit 9c34e04a9e3f0aae3661d2e63f2e3cfaa6236eda Author: Matt Falkenhagen <falken@chromium.org> Date: Thu Jan 17 04:34:18 2019 service worker: WPT: Add generated response tests for XHR response URL. respondWith(new Response()) is a little tricky for response URL so it's good to have a test for it. Bug: 915126 Change-Id: I21fbc654687d467baf14f02c23f4e41d18ac79ab Reviewed-on: https://chromium-review.googlesource.com/c/1415613 Reviewed-by: Kenichi Ishibashi <bashi@chromium.org> Commit-Queue: Matt Falkenhagen <falken@chromium.org> Cr-Commit-Position: refs/heads/master@{#623577} [add] https://crrev.com/9c34e04a9e3f0aae3661d2e63f2e3cfaa6236eda/third_party/blink/web_tests/external/wpt/service-workers/service-worker/resources/xhr-response-url-worker.js [modify] https://crrev.com/9c34e04a9e3f0aae3661d2e63f2e3cfaa6236eda/third_party/blink/web_tests/external/wpt/service-workers/service-worker/xhr-response-url.https-expected.txt [modify] https://crrev.com/9c34e04a9e3f0aae3661d2e63f2e3cfaa6236eda/third_party/blink/web_tests/external/wpt/service-workers/service-worker/xhr-response-url.https.html
The following revision refers to this bug: https://chromium.googlesource.com/chromium/src.git/+/47e1c4bb479ec3aa5be900e2ff99de165baa31cc commit 47e1c4bb479ec3aa5be900e2ff99de165baa31cc Author: Matt Falkenhagen <falken@chromium.org> Date: Thu Jan 17 05:27:34 2019 xhr: Use the response URL for responseURL and document URL. Aligns with the spec, see bug. Chrome Status: https://www.chromestatus.com/feature/5676711949631488 Bug: 915126 Change-Id: I7d30a902f95a9e34b32eed891d4e2c3fb983dd71 Reviewed-on: https://chromium-review.googlesource.com/c/1415057 Commit-Queue: Matt Falkenhagen <falken@chromium.org> Reviewed-by: Yutaka Hirano <yhirano@chromium.org> Cr-Commit-Position: refs/heads/master@{#623594} [modify] https://crrev.com/47e1c4bb479ec3aa5be900e2ff99de165baa31cc/third_party/blink/renderer/core/xmlhttprequest/xml_http_request.cc [delete] https://crrev.com/fe6c0d4a09bbda7bc46f0938fcc56b324c83edfe/third_party/blink/web_tests/external/wpt/service-workers/service-worker/xhr-response-url.https-expected.txt
Comment 1 by falken@chromium.org
, Jan 16 (6 days ago)