Pick the shortest reasonable Prefer / upgrade header · Issue #216 · w3c/webappsec · GitHub
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

Pick the shortest reasonable Prefer / upgrade header #216

Closed
pde opened this issue Mar 17, 2015 · 13 comments
Closed

Pick the shortest reasonable Prefer / upgrade header #216

pde opened this issue Mar 17, 2015 · 13 comments
Labels

Comments

@pde
Copy link
Contributor

pde commented Mar 17, 2015

We've gone from Prefer: representation=secure to Prefer: https to Prefer: tls. That's pretty good, 11 characters, 13 bytes on the wire, but should we go further?

An even shorter option which I'm stealing from #212 is Upgrade: 1, 10 characters. Or we could do Pref: tls, 8 chacters. Or go all the way to TLS: 1 or HS: 1 for "hypertext secure", 5 characters, 7 bytes on the wire?

There are some aesthetic / clarity arguments for stopping at some point along this line, and I feel I lack data for where to put the pin.

@pde pde changed the title Pick the shortest possible Prefer / upgrade header Pick the shortest reasonable Prefer / upgrade header Mar 17, 2015
@mikewest
Copy link
Member

Prefer has the advantage of being an existing header, which means that in the best case (when Prefer was already being sent by the client), we'd be at 4 characters ,tls. I think it's reasonable to stop where we are. :)

@mikewest
Copy link
Member

+@igrigorik

@igrigorik
Copy link
Member

Is there any case under which "Prefer: https" might affect the caching policy? If so, then we should split it into a separate header due to limitations of Vary. If not, then +1 for "Prefer: https"... because clarity is good, and TLS is not the only secure transport option - e.g. QUIC?

@mikewest
Copy link
Member

@mnot suggested that Vary: Prefer would do what we need (see the example in the doc). Is that not the case?

@mikewest
Copy link
Member

Also, I forgot about QUIC, et al, and discounted opportunistic encryption. Ugh.

Is there a name that works? At all?

@igrigorik
Copy link
Member

If "https" is the only token advertised via Prefer, yes that's fine. However, the fact that its an existing header means that other values may be advertised as well, at which point "Prefer: x,y,z" forces "x,y,z" to become part of the cache key, evne if x and y have no business of being part of the cache key.

I went through same exercise with CH, see: igrigorik/http-client-hints#14

@mikewest
Copy link
Member

:(

HTTPS: plz? We can't use Upgrade, as that already has meaning. U is a thing, I guess, but I really don't like that it's completely incomprehensible on the one hand and ungoogleable on the other.

@pde
Copy link
Contributor Author

pde commented Mar 18, 2015

Sec: Y, Sec: 1, HTTPS: Y, HTTPS: 1?

@mikewest
Copy link
Member

HTTP: S. sigh All of these are, to quote @mnot, horrible horrible. :(

If it's going to be horrible horrible, HTTPS: 1 seems at least descriptively horrible. Let's run with that for the moment.

@pde
Copy link
Contributor Author

pde commented Mar 18, 2015

HTTP: S may be many kinds of horrible, but it's also poetry :)

@pde
Copy link
Contributor Author

pde commented Mar 18, 2015

I suspect HTTPS: 1 is more googleable though.

@Krinkle
Copy link
Member

Krinkle commented Jul 1, 2015

@pde It is, and thanks!

Searching "HTTPS: 1 header" led me to
http://www.w3.org/TR/upgrade-insecure-requests/
 (which in turn points here)

@glensc
Copy link

glensc commented Jul 19, 2017

HTTPS: 1 was horrible decision, as such header is quite commonly used in proxy solutions, so backend servers received: CGI variable like HTTP_HTTPS: 1, on and that broke quite some setups.

Luckily that HTTPS: 1 existed only shorty, Chrome/44 only, and was changed to upgrade-insecure-requests header later.

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

No branches or pull requests

5 participants