Bug 233916 - Safari Bug "no-cache" network error
Summary: Safari Bug "no-cache" network error
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Service Workers (show other bugs)
Version: Safari 15
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: youenn fablet
URL:
Keywords: InRadar
: 236084 (view as bug list)
Depends on:
Blocks:
 
Reported: 2021-12-07 00:34 PST by Janos Wartig
Modified: 2022-03-14 04:01 PDT (History)
8 users (show)

See Also:


Attachments
Patch (9.09 KB, patch)
2021-12-08 02:32 PST, youenn fablet
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Janos Wartig 2021-12-07 00:34:01 PST
A fetch request on the page that sets the cache: "no-cache" will result in a network error when it is fetched by a Service Worker.
The error that is thrown looks like this:
TypeError: Request header field Cache-Control is not allowed by Access-Control-Allow-Headers

I implemented a simple test page that reproduces the issue here: https://testjanos.app.baqend.com/
The test page registers a simple Service Worker which listens to fetch requests and tries to fetch them.
It also includes the following script tag:
	<script>
      let options = { method: "POST", cache: "no-cache", mode: "cors", body: '{"weather":true}' };
	  fetch("https://dcinfos-cache.abtasty.com/v1/geoip", options);
	</script>

Ways to reproduce:
1. Go to https://testjanos.app.baqend.com/
2. Open Service Workers view (Developer -> Service Workers)
3. Refresh the page
4. Observe that resource https://dcinfos-cache.abtasty.com/v1/geoip could not be fetched due to above error (error prited to the Service Worker console)

Is there any fix for this issue?
Comment 1 youenn fablet 2021-12-08 02:32:40 PST
Created attachment 446342 [details]
Patch
Comment 2 Chris Dumez 2021-12-08 07:18:08 PST
Comment on attachment 446342 [details]
Patch

r=me
Comment 3 EWS 2021-12-08 08:01:03 PST
Committed r286655 (244968@main): <https://commits.webkit.org/244968@main>

All reviewed patches have been landed. Closing bug and clearing flags on attachment 446342 [details].
Comment 4 Radar WebKit Bug Importer 2021-12-08 08:02:24 PST
<rdar://problem/86211355>
Comment 5 youenn fablet 2022-03-14 04:01:31 PDT
*** Bug 236084 has been marked as a duplicate of this bug. ***