[Webkit-unassigned] [Bug 236973] New: Missing content type header for requests with non-safe content type

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Mon Feb 21 06:31:01 PST 2022


https://bugs.webkit.org/show_bug.cgi?id=236973

            Bug ID: 236973
           Summary: Missing content type header for requests with non-safe
                    content type
           Product: WebKit
           Version: Safari 15
          Hardware: Unspecified
                OS: Unspecified
            Status: NEW
          Severity: Normal
          Priority: P2
         Component: Service Workers
          Assignee: webkit-unassigned at lists.webkit.org
          Reporter: kt at baqend.com

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?

-- 
You are receiving this mail because:
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.webkit.org/pipermail/webkit-unassigned/attachments/20220221/1ec93d4d/attachment.htm>


More information about the webkit-unassigned mailing list