Bug 272743 - Responses with code 204 misbehave on Mobile (e.g., COOP is active)
Summary: Responses with code 204 misbehave on Mobile (e.g., COOP is active)
Status: NEW
Alias: None
Product: WebKit
Classification: Unclassified
Component: Page Loading (show other bugs)
Version: Safari 17
Hardware: Unspecified iOS 17
: P2 Normal
Assignee: Nobody
URL:
Keywords: BrowserCompat, InRadar
Depends on:
Blocks:
 
Reported: 2024-04-16 04:29 PDT by jannis.rautenstrauch
Modified: 2024-04-23 06:05 PDT (History)
4 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description jannis.rautenstrauch 2024-04-16 04:29:18 PDT
If a response with status code 204 is opened in a new tab (with window.open), it seems to be treated like about:blank in all browsers (Safari Desktop, Firefox, Chromium) except for Safari Mobile.

On Safari mobile, the response is opened like a normal response and even headers such as COOP take effect.
I would expect the same behavior on mobile and desktop.

Example URL that opens a 204 response with a COOP header: http://sub.headers.websec.saarland/_hp/tests/window-references-coop.sub.html?resp_type=parsing&browser_id=1&label=COOP&first_id=23342&last_id=23342&scheme=http&t_resp_id=23342&t_element_relation=direct_direct&t_resp_origin=https://headers.webappsec.eu
Comment 1 Radar WebKit Bug Importer 2024-04-23 04:30:23 PDT
<rdar://problem/126914077>
Comment 2 Ahmad Saleem 2024-04-23 05:47:45 PDT
@Jannis - I loaded the following example URL in mobile Safari (iOS 17.4.1) and it shows the test as 'Pass'.

Do we need to look into header details via Web Inspector? Appreciate if you can share more details, so I can reproduce this.
Comment 3 jannis.rautenstrauch 2024-04-23 06:05:23 PDT
@Ahmad I use a modified version of WPT that (usually) always pass all tests as I use it for differential testing.

The outcome of the test is shown in the outcome column.
- On Safari Desktop (and all other browser) the outcome is {"window.open.opener":"object \"[object Window]\""}, the opened window shows about:blank in the URL bar and closes after 15s.
- On Safari Mobile the outcome is {"window.open.opener":"null"}	, the opened window shows https://headers.webappsec.eu in the URL bar and it is not closed (as COOP is active on that response)