Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix XHR/Fetch API when hitting <link rel=preload as=fetch>
Previously, when XHR/fetch API reuses a <link rel=preload as=fetch> response with HTTP 4xx, XHR onabort was fired and fetch API's text() was stalled (never resolved nor rejected), due to loading cancellation, while XHR/fetch API should be successful because HTTP 4xx isn't considered as a network error in the spec. This CL fixes this by not considering HTTP 4xx as an error. As a side effect, this CL fires load events instead of error events for <link rel=preload as=fetch> + HTTP 4xx. While the desired behavior about the events on `<link rel=preload as=fetch>` are still under discussion at whatwg/html#1142, changing the event on Chromium is probably fine, because Firefox/Safari fire different events (load/error, respectively) for HTTP 4xx. Original attempt: https://chromium-review.googlesource.com/c/chromium/src/+/3540965 Bug: 1305317, 1318618 Change-Id: Ic8ec587599f4db28837ed3c1b19b2a5a58e1a4c4 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3585999 Reviewed-by: Mason Freed <[email protected]> Commit-Queue: Hiroshige Hayashizaki <[email protected]> Cr-Commit-Position: refs/heads/main@{#996524} NOKEYCHECK=True GitOrigin-RevId: 2feeb37f75b06beea1bafa843a11f9199ffb3739
- Loading branch information