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
Seems the REGEX used inside Links parse(@ Nullable String source); function is not compliant with a part of RFC8288 Section 3 : https://www.rfc-editor.org/rfc/rfc8288.html#section-3
Related to the usage of "rel" attribute, seems it could be use in both following way (quoted and not quoted value):
rel=boo
rel="boo"
Extract from RFC8288:
Link Serialisation in HTTP Headers
The Link header field provides a means for serialising one or more
links into HTTP headers.
Note that any link-param can be generated with values using either
the token or the quoted-string syntax; therefore, recipients MUST be
able to parse both forms. In other words, the following parameters
are equivalent:
x=y
x="y"
The function do not parse the header correctly if we got a rel value without quotes.
I did a fork with a unit test which is failing currently, but if what i am saying is right, it should pass after the fix: #1898
I know a RFC can be misinterpreted so feel free to tell me if i am wrong and if "rel" value MUST be quoted all the time.
Regards,
The text was updated successfully, but these errors were encountered:
…bute values.
Fixed the regular expression to parse link header values to properly consider the comma to end an unquoted attribute value, too. Couple of additional unit tests, too.
odrotbohm
changed the title
Support unquoted rel value in Links Header - RFC8288 Section 3
Link header parsing breaks for multiple links with at least one containing unquoted values
Feb 15, 2023
Good catch! It's not been unquoted values per se, but the combination of multiple links and the regex not properly detecting a value ending at a comma. I applied your PR and expanded the test cases in the actual fix. Backported to 2.0.x and 1.5.x, both due to ship releases this Friday.
Hello,
Seems the REGEX used inside Links parse(@ Nullable String source); function is not compliant with a part of RFC8288 Section 3 : https://www.rfc-editor.org/rfc/rfc8288.html#section-3
Related to the usage of "rel" attribute, seems it could be use in both following way (quoted and not quoted value):
Extract from RFC8288:
The function do not parse the header correctly if we got a rel value without quotes.
I did a fork with a unit test which is failing currently, but if what i am saying is right, it should pass after the fix: #1898
I know a RFC can be misinterpreted so feel free to tell me if i am wrong and if "rel" value MUST be quoted all the time.
Regards,
The text was updated successfully, but these errors were encountered: