[Webkit-unassigned] [Bug 203617] New: "ReadableStream uploading is not supported" when fetch()ing a Request that has been logged to console

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Wed Oct 30 10:40:25 PDT 2019


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

            Bug ID: 203617
           Summary: "ReadableStream uploading is not supported" when
                    fetch()ing a Request that has been logged to console
           Product: WebKit
           Version: Safari 13
          Hardware: All
                OS: All
            Status: NEW
          Severity: Normal
          Priority: P2
         Component: Service Workers
          Assignee: webkit-unassigned at lists.webkit.org
          Reporter: webkit at posnick.org

Created attachment 382328

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

Screenshot of the failure sequence.

This came up at https://github.com/GoogleChrome/workbox/issues/1732, and was originally mentioned at https://stackoverflow.com/questions/49850705. While it has more to do with the Fetch API than Service Workers, I didn't see a dedicated Component for Fetch, so I chose Service Workers.

An attempt to call fetch(request) will lead to a "NotSupportedError: ReadableStream uploading is not supported" when request is a Request object that contains a body and has been previously logged to the JS console. This failure occurs whether the logging is implicit, by virtue of typing in an interactive command in the JS console (which logs the return value immediately after execution) or explicit from code, via console.log(request).

You can reproduce this issue by navigating to https://example.com in any recent version of Safari (I tested with Safari 13 on OS X 10.14.6), choosing "Show JavaScript console" from the Develop menu, and entering the following:

> res = await fetch(new Request('https://example.com', {method: 'POST', body: Math.random()}))
< undefined
[Info] Response {type: "basic", url: "https://example.com/", redirected: false, status: 200, ok: true, …}

> req = new Request('https://example.com', {method: 'POST', body: Math.random()})
< Request {method: "POST", url: "https://example.com/", headers: Headers, destination: "", referrer: "about:client", …}
> res = await fetch(req)
NotSupportedError: ReadableStream uploading is not supported

The first sequence succeeds, because the new Request is created inside of the fetch() call and is not logged to the JS console.

The second sequence fails, because the new Request is logged to the JS console automatically after creation, and then using it via fetch(req) triggers the exception.

Attached is a screenshot of this in action if that's easier to follow.

No other browsers demonstrate this issue. Logging a request to the JS console should change whether or not the request is eligible to be sent via fetch(). Presumably whatever ends up implicitly converting the Request body to a ReadableStream should be disabled when logging to the JS console.

-- 
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/20191030/0b1575c8/attachment-0001.htm>


More information about the webkit-unassigned mailing list