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

Change LinkHeaders to use ",\n" as delimiter in Link HTTP header #193

Merged
merged 1 commit into from Jul 21, 2016

Conversation

Projects
None yet
2 participants
@petedmarsh
Contributor

petedmarsh commented Apr 15, 2016

Previously LinkHeaders would delimit multiple links with \n alone
like so:

Link: <http://example.org/a>; rel="next"
      <http://example.org/b>; rel="prev"

However, comma + newline is used as the delimiter in the
specification's (https://tools.ietf.org/html/rfc5988#section-5.5)
examples and, additionally, it states:

Note that extension relation types are REQUIRED to be absolute
URIs in Link headers, and MUST be quoted if they contain a
semicolon (";") or comma (",") (as these characters are used as
delimiters in the header itself).

In comma + newline appears to be the standard in practice (e.g.
GitHub's API). This changes LinkHeaders to use comma + newline as
the delimieter between multiple links, e.g:

Link: <http://example.org/a>; rel="next",
      <http://example.org/b>; rel="prev"
Change LinkHeaders to use ",\n" as delimiter in Link HTTP header
Previously LinkHeaders would delimit multiple links with \n alone
like so:

    Link: <http://example.org/a>; rel="next"
          <http://example.org/b>; rel="prev"

However, comma + newline is used as the delimiter in the
specification's (https://tools.ietf.org/html/rfc5988#section-5.5)
examples and, additionally, it states:

> Note that extension relation types are REQUIRED to be absolute
> URIs in Link headers, and MUST be quoted if they contain a
> semicolon (";") or comma (",") (as these characters are used as
> delimiters in the header itself).

In comma + newline appears to be the standard in practice (e.g.
GitHub's API). This changes LinkHeaders to use comma + newline as
the delimieter between multiple links, e.g:

    Link: <http://example.org/a>; rel="next",
          <http://example.org/b>; rel="prev"

@zzak zzak added this to the 2.0.0 milestone May 4, 2016

@zzak

This comment has been minimized.

Show comment
Hide comment
@zzak

zzak May 4, 2016

Member

Thanks, I need to review the spec but I will get back to you once I make a decision

Member

zzak commented May 4, 2016

Thanks, I need to review the spec but I will get back to you once I make a decision

@zzak zzak merged commit 039d375 into sinatra:master Jul 21, 2016

1 check passed

continuous-integration/travis-ci/pr The Travis CI build passed
Details
@zzak

This comment has been minimized.

Show comment
Hide comment
@zzak

zzak Jul 21, 2016

Member

@petedmarsh Sounds good to me! Thanks for the patch

Member

zzak commented Jul 21, 2016

@petedmarsh Sounds good to me! Thanks for the patch

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment