[Webkit-unassigned] [Bug 187461] New: Fetch using FromData with file doesn't go through Service Worker

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Mon Jul 9 02:15:03 PDT 2018


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

            Bug ID: 187461
           Summary: Fetch using FromData with file doesn't go through
                    Service Worker
           Product: WebKit
           Version: Safari Technology Preview
          Hardware: All
                OS: Unspecified
            Status: NEW
          Severity: Normal
          Priority: P2
         Component: Service Workers
          Assignee: webkit-unassigned at lists.webkit.org
          Reporter: cedric at nyrodev.com

Created attachment 344569

  --> https://bugs.webkit.org/attachment.cgi?id=344569&action=review

Zip containing all 4 files described

When using a FormData with file to send content of a form using the fetch API, the request doesn't go through the associated Service Worker.

To show it, I setup the attached file :  

# index.html
Contains 3 forms with a simple debug div to show what's happening on devices

# test.js
Handle the submit of the form in order to:
1. prevent default it
2. Create a formData
3. If the form has the id "removeFile", delete the file from the formData
4. Send data to service worker/server using the fetch API
5. Get a JSON response
6. Show the json response on the debug

# sw.js
A minimal service worker that only add a "X-FROM-SW" header to the request containing the timestamp

# up.php
A simple PHP script to return a JSON with the received "X-FROM-SW" or false if not found.


# Observed results
- Simple Form : everything ok as expected and the result contains the X-FROM-SW
- File form : doesn't pass through the service worker (no log in the fetch event), so there is no header added
- Remove file form : treated like the simple form, so the result contains the X-FROM-SW

I setup these file on the following URL:
https://bugs.nyro.com/safariFileUpload/

-- 
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/20180709/89f18870/attachment-0001.html>


More information about the webkit-unassigned mailing list