Comments (16)
This appears like a browser issue to me. There is and never was an intention to have different rules.
from http-core.
I'm not sure what that means. If it affects browsers, why would it not affect other clients in the HTTP ecosystem? Don't we all consume the same content?
from http-core.
Once again, there are no different rules. Browsers apparently implemented workarounds for misconfigured servers, but that doesn't mean that what browsers do is what everybody else is doing.
from http-core.
Do we need to do more than reference mimesniff (see #51)? Note there's already generic text about sniffing in Content-Type.
from http-core.
This issue is really about parsing Content-Type
and determining its (parsed) value, irrespective of any sniffing that might also take place.
from http-core.
More concretely, text/html, text/plain
means text/plain
in browsers. text/plain;
means text/plain
(not an error). text/html;charset=gbk
, text/html
means text/html;charset=gbk
(yup, charset
is copied over as a special case).
whatwg/fetch#831 has a patch for Fetch to define this in detail with an acknowledgment that it doesn't match HTTP.
It seems greatly preferable to uplift this kind of thing and agree on header parsers across the HTTP ecosystem, but if that's not doable so be it.
from http-core.
Discussed in Basel; we could document a suggested error handling algorithm, as long as it's clear that rejecting the message because the content-type is invalid is still acceptable.
Suggested algorithm would be to use the last syntactically valid type. @annevk does that align with fetch?
from http-core.
More than today, but it's also more involved: https://fetch.spec.whatwg.org/#content-type-header.
from http-core.
Waiting for terminology from #193.
from http-core.
I just updated my ancient tests for content-type, see http://test.greenbytes.de/tech/tc/httpcontenttype.
To my surprise, Safari apparently handles comma-separated different from multiple fields, see http://test.greenbytes.de/tech/tc/httpcontenttype/#multitextxmloneline.
@annevk, that would be a bug according to FETCH, right?
from http-core.
Yes, I suspect there's a bug filed already. I think I found such bugs in all browsers as they all have very similar logic in their core HTTP parsers.
from http-core.
Ah. But then, I'm not really convinced that we should add this to the spec. My understanding that the request was based on browsers already agreeing on the error handling...
from http-core.
There's no complete agreement on all details involved. See whatwg/fetch#831 (comment) for links to bugs.
from http-core.
I did some more testing with Java client libs (HTTPURLConnection, JDK HttpClient, Apache HttpClient). Of these, only the first seems to have an API getting the type directly, and that indeed takes the last value (no matter whether sent as list in a single instance, or in multiple fields).
It would be nice if there was a concrete Webkit bug that points out their inconsistency (see #39 (comment)) (cc @tfpauly).
from http-core.
I recommend either filing one that blocks https://bugs.webkit.org/show_bug.cgi?id=192000 or detailing the specific case you care about there in a comment.
from http-core.
done: https://bugs.webkit.org/show_bug.cgi?id=215604
from http-core.
Related Issues (20)
- RFC 9110 does change requirements from RFC 2818 HOT 1
- Definition of status code 308 should mention that request method MUST NOT be changed
- multiple locations for 301/308 redirects? HOT 5
- how to handle C-L for unknown methods HOT 3
- incorrect media type weight in example
- A Single LF Line Terminator in RFC 9112 HOT 4
- OWS in ranges-specifier missing(?)
- charset names are used in Accept-Charset, not Accept-Encoding HOT 1
- http 1.1 message body (section 6) and get/head/delete semantics HOT 1
- If-Range distinguishing entity-tag from HTTP-date can be more refined HOT 1
- Missing changes - determining target URI authority
- absolute-form explanations are a bit confusing
- Media Type message/http requirements HOT 1
- Semantics of informational responses. HOT 2
- Caching: Vary, Conneg, and choosing the latest response HOT 1
- Caching: give caches more flexibility to calculate Age
- If-Match and caching intermediaries HOT 1
- rfc 9112: incorrect link in ABNF
- Clarification on messages with invalid Content-Length and valid Transfer-Encoding HOT 8
- RFC 9110, section 8.6: Incorrect use of the word "exception."
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from http-core.