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

Translate Host -> :authority #9

Closed
pranaygp opened this issue Nov 8, 2017 · 5 comments
Closed

Translate Host -> :authority #9

pranaygp opened this issue Nov 8, 2017 · 5 comments

Comments

@pranaygp
Copy link

pranaygp commented Nov 8, 2017

curl does this thing where, when you use http2, it'll translate the Host header to the :authority pseudo-header.

Is that something fetch-h2 should be doing too before making a request?

@matheuss
Copy link

matheuss commented Nov 8, 2017

I was investigating this earlier and tried to set my own :authority, but it's not allowed 🤔 I suppose it's a bug since the spec allows it?

@grantila
Copy link
Owner

grantila commented Nov 8, 2017

Yeah, the spec doesn't allow any pseudo-headers.

A field name MUST be composed of printable US-ASCII characters (i.e., characters that have values between 33 and 126, inclusive), except colon.

This is probably why they chose to use colon for psuedo-headers, simply because they aren't legal real headers.

Converting Host to :authority does seem reasonable. @pranaygp did curl convert it or copy it to :authority, i.e. did it remove host as header, or have both of them?

@pranaygp
Copy link
Author

pranaygp commented Nov 8, 2017

It's definitely replacing it @grantila
based on this fragment in curl

https://github.com/curl/curl/blob/544bfdebea2a9e8be1c01fc7954cd49638fe2803/lib/http2.c#L1888-L1896

@grantila
Copy link
Owner

grantila commented Nov 9, 2017

Great digging, Sherlock.

@grantila
Copy link
Owner

grantila commented Nov 9, 2017

Released in 0.0.12

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants