Bug 236973
Summary: | Missing content type header for requests with non-safe content type | ||
---|---|---|---|
Product: | WebKit | Reporter: | Kevin Twesten <kt> |
Component: | Service Workers | Assignee: | Nobody <webkit-unassigned> |
Status: | RESOLVED DUPLICATE | ||
Severity: | Normal | CC: | achristensen, cdumez, webkit-bug-importer, youennf |
Priority: | P2 | Keywords: | InRadar |
Version: | Safari 15 | ||
Hardware: | Unspecified | ||
OS: | Unspecified |
Kevin Twesten
When sending a request with a non-safe content type (e.g. a blob via sendBeacon), the "content-type" header is missing when it is fetched by a Service Worker.
This happens for cross-origin requests as well as for same-origin requests.
I implemented a simple test page that reproduces the issue here: https://good-breeze-16.app.baqend.com/
The test page registers a simple Service Worker which listens to fetch requests, logs the seen request headers, and does the fetch.
The test page also includes the following script tag that sends the beacon requests:
<script>
// Cross Origin
var blob = new Blob([JSON.stringify({"weather":true})], { type: "application/json" });
navigator.sendBeacon('https://dm-clone.app.baqend.com/v1/code/endpoint?type=beaconStrange', blob);
// Same origin
var blob = new Blob([JSON.stringify({"weather":true})], { type: "application/json" });
navigator.sendBeacon('https://good-breeze-16.app.baqend.com/v1/code/endpoint?type=beaconStrange', blob);
</script>
Ways to reproduce:
1. Navigate to https://good-breeze-16.app.baqend.com/
2. Open Service Workers view (Developer -> Service Workers)
3. Refresh the page
4. Check the request headers printed in the Service Worker console and see that the "content-type" header is missing for both beacon requests.
Is there any fix for this issue?
Attachments | ||
---|---|---|
Add attachment proposed patch, testcase, etc. |
Radar WebKit Bug Importer
<rdar://problem/89382511>
youenn fablet
*** This bug has been marked as a duplicate of bug 236837 ***
youenn fablet
> Is there any fix for this issue?
Thanks for the report, this should be fixed now in ToT.