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
{{ message }}
Repository navigation
Link Header pagination fails when there's no space between ';' and 'rel' #5667
The * is interesting. I couldn't find whether they mean "zero or more" spaces or "one or more" spaces. I'm not sure it really matters. The current regex definitely doesn't cover either. 😃
whether they mean "zero or more" spaces or "one or more" spaces
At the risk of being pedantic, the specification doesn't explicitly allow any whitespace there. The *() indicates one or more instances of ;link-param can follow <URI-Reference> - with no whitespace after the > or bfore the ; .
That said, RFC5988 follows RFC2616 ABNF notation, which implicitly allows for linear white space (LWS) between any two adjacent tokens or quoted-strings, and between adjacent words and separators.
implied *LWS
The grammar described by this specification is word-based. Except
where noted otherwise, linear white space (LWS) can be included
between any two adjacent words (token or quoted-string), and
between adjacent words and separators, without changing the
interpretation of a field. At least one delimiter (LWS and/or
separators) MUST exist between any two tokens (for the definition
of "token" below), since they would otherwise be interpreted as a
single token.
In link-value = "<" URI-Reference ">" *( ";" link-param ), ";" is a quoted string and link-param is a token, so the space is implicitly allowed between them, but not required.
Anyway, I think we're on the same page; just wanted to clarify the interpretation of the RFC
Activity
markekraus commentedon Dec 11, 2017
Hmm rfc has
The
*is interesting. I couldn't find whether they mean "zero or more" spaces or "one or more" spaces. I'm not sure it really matters. The current regex definitely doesn't cover either. 😃I'm ok with the proposed change.
cruscio commentedon Dec 11, 2017
At the risk of being pedantic, the specification doesn't explicitly allow any whitespace there. The
*()indicates one or more instances of;link-paramcan follow<URI-Reference>- with no whitespace after the>or bfore the;.That said, RFC5988 follows RFC2616 ABNF notation, which implicitly allows for linear white space (LWS) between any two adjacent tokens or quoted-strings, and between adjacent words and separators.
https://tools.ietf.org/html/rfc2616#section-2.2
https://tools.ietf.org/html/rfc2616#section-2.1
In
link-value = "<" URI-Reference ">" *( ";" link-param ),";"is a quoted string andlink-paramis a token, so the space is implicitly allowed between them, but not required.Anyway, I think we're on the same page; just wanted to clarify the interpretation of the RFC
markekraus commentedon Dec 11, 2017
Ugh.. one of these days I will learn how to properly translate RFC's into actual things... Today is not that day. Thanks for explaining.