-
Notifications
You must be signed in to change notification settings - Fork 329
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Feature detecting request stream bodies #1275
Comments
Why should the specification allow for Safari's behavior? |
I'm not set on adding that bit to the spec, I just want to ensure the feature detect is more likely to work long term. Right now they should move their point of rejection so it happens later than Scheme Fetch, which means the feature detect reports a false positive. I want to avoid that as much as possible. |
Couldn't they adopt the stringification behavior still? At least until they get around to supporting upload streams. In any event, I'm not aware of specifications defining what should happen for half support of features. You either have to implement it or not support it at all. |
As in, ask them to remove support for streams in |
It seems at that point they should return early. It's probably worth sharing that code with them though when making such a request. 😊 |
Just to double check, you don't think that code should go in a wpt? |
I'd be okay with adding a modified version of that code to WPT, e.g., to test that |
Test PR web-platform-tests/wpt#29849 |
Test PR merged |
…etects, a=testonly Automatic update from web-platform-tests Add tests for streaming upload feature detects (#29849) Discussed in whatwg/fetch#1275 -- wpt-commits: fe6e8e875bc09f5f37bb610c81a698ee53c71739 wpt-pr: 29849
I'm trying to figure out a way to feature-detect request streaming without requiring a network connection.
Unfortunately Safari complicates this, as it supports creating
Request
objects with stream bodies, but it doesn't support using them withfetch()
.However, I've come up with the following:
Browsers that don't support streams in request objects would interpret the
ReadableStream
as a string, and therefore set theContent-Type
totext/plain;charset=UTF-8
, so that's an early exit.Otherwise, it performs a fetch to a data url using a stream body. This depends on a few things:
POST
ing to a data-url is fine, even if the body is a stream. The spec support this, and browsers seem to allow it.Proposal:
WDYT?
The text was updated successfully, but these errors were encountered: