Skip to content
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

Link header #650

Closed
Antti opened this issue Sep 8, 2015 · 4 comments
Closed

Link header #650

Antti opened this issue Sep 8, 2015 · 4 comments
Labels
A-headers Area: headers. E-easy Effort: easy. A task that would be a great starting point for a new contributor.

Comments

@Antti
Copy link

Antti commented Sep 8, 2015

Currently, as far as I know there's no facility to parse and generate Link headers,
It would be very useful if we had one, many APIs (including github) uses it to navigate.

Do we plan to add support for it?

http://www.w3.org/wiki/LinkHeader
http://www.rfc-editor.org/rfc/rfc5988.txt

@seanmonstar
Copy link
Member

Sounds fine to me.

@seanmonstar seanmonstar added A-headers Area: headers. E-easy Effort: easy. A task that would be a great starting point for a new contributor. labels Sep 8, 2015
@Antti
Copy link
Author

Antti commented Sep 9, 2015

It seems like this header is more complicated than others, just by judging it's ABNF:

Link           = "Link" ":" #link-value
link-value     = "<" URI-Reference ">" *( ";" link-param )
link-param     = ( ( "rel" "=" relation-types )
               | ( "anchor" "=" <"> URI-Reference <"> )
               | ( "rev" "=" relation-types )
               | ( "hreflang" "=" Language-Tag )
               | ( "media" "=" ( MediaDesc | ( <"> MediaDesc <"> ) ) )
               | ( "title" "=" quoted-string )
               | ( "title*" "=" ext-value )
               | ( "type" "=" ( media-type | quoted-mt ) )
               | ( link-extension ) )
link-extension = ( parmname [ "=" ( ptoken | quoted-string ) ] )
               | ( ext-name-star "=" ext-value )
ext-name-star  = parmname "*" ; reserved for RFC2231-profiled
                              ; extensions.  Whitespace NOT
                              ; allowed in between.
ptoken         = 1*ptokenchar
ptokenchar     = "!" | "#" | "$" | "%" | "&" | "'" | "("
               | ")" | "*" | "+" | "-" | "." | "/" | DIGIT
               | ":" | "<" | "=" | ">" | "?" | "@" | ALPHA
               | "[" | "]" | "^" | "_" | "`" | "{" | "|"
               | "}" | "~"
media-type     = type-name "/" subtype-name
quoted-mt      = <"> media-type <">
relation-types = relation-type
               | <"> relation-type *( 1*SP relation-type ) <">
relation-type  = reg-rel-type | ext-rel-type
reg-rel-type   = LOALPHA *( LOALPHA | DIGIT | "." | "-" )
ext-rel-type   = URI

@tabac
Copy link
Contributor

tabac commented Jan 31, 2017

@seanmonstar Hi, I'd like to give this a try if you're OK, we still want this right?

@seanmonstar
Copy link
Member

@tabac sure!

tomprince pushed a commit to tomprince/hyper-rs that referenced this issue May 18, 2017
tomprince pushed a commit to tomprince/hyper-rs that referenced this issue May 18, 2017
tomprince pushed a commit to tomprince/hyper-rs that referenced this issue May 18, 2017
tomprince pushed a commit to tomprince/hyper-rs that referenced this issue May 18, 2017
tomprince pushed a commit to tomprince/hyper-rs that referenced this issue May 22, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-headers Area: headers. E-easy Effort: easy. A task that would be a great starting point for a new contributor.
Projects
None yet
Development

No branches or pull requests

3 participants