You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
However in practice it seems that this specific grammar is relaxed to a larger set of allowed characters. I made a small test which checks this behavior:
Then visited localhost:4040 in Firefox. The recorded execution also showed the delimiter in the token value:
Based on the test assertions and the firefox screenshot it seems consistent that both programs allow characters outside the grammar specified in RFC91100.
Was this intentional at the time of writing the tokenization code?
Would it possible to have a strict mode which would reject more field values for invalid tokens?
The text was updated successfully, but these errors were encountered:
It's true that the is_token method differs from the spec, which was motivated by real world traffic. However, the parts you're showing, header values, are not defined to be tokens even in the spec. Header values are defined as:
Thanks for clarifying! When I re-read, I think then only field-names are defined as tokens: https://www.rfc-editor.org/rfc/rfc9110#section-5.1-2? I see it used in a couple other places like methods, parameter names, connection options, etc.
RFC 9110 Section 5.6.2 defines the grammar for field value tokens as
However in practice it seems that this specific grammar is relaxed to a larger set of allowed characters. I made a small test which checks this behavior:
I also checked how Firefox handles this header with a small program
Then visited
localhost:4040
in Firefox. The recorded execution also showed the delimiter in the token value:Based on the test assertions and the firefox screenshot it seems consistent that both programs allow characters outside the grammar specified in RFC91100.
The text was updated successfully, but these errors were encountered: