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

Magic #25

Closed
mnot opened this issue Feb 19, 2013 · 4 comments
Closed

Magic #25

mnot opened this issue Feb 19, 2013 · 4 comments

Comments

@mnot
Copy link
Member

mnot commented Feb 19, 2013

We need some magic that clearly indicates that HTTP/2 is being spoken on the wire. It should fast fail when sent to a reasonable set of HTTP/1.1 servers.

@mnot
Copy link
Member Author

mnot commented May 20, 2013

In the draft, so closing (although we might tweak the string as time goes on).

@phluid61
Copy link
Contributor

phluid61 commented Jun 3, 2013

If the goal of the connection header magic string is to emulate a HTTP/1.x request in a way that is both as transparent as possible (can be parsed as HTTP/1.x) and unambiguously differentiated (could NOT be understood as HTTP/1.x), I understand the criteria to be:

When interpreted as a HTTP/1.x request:

  • the HTTP-Version must be "HTTP/2.0";
  • the Request-URI must be "*", since this message is not resource-specific;
  • the Method should not coincide with any extant HTTP/1.x methods, since a poorly-implemented device might, for example, only inspect the minor part of the HTTP-Version and misinterpret the header as a HTTP/1.0 request;
  • the Method should be exactly three or four bytes in length, since there are known implementations in the wild that have this expectation.

To fit in a 24-byte structure, using the given pattern, we would have to use either a three-byte Method and a two-byte entity (before the final "\r\n\r\n"), or a four-byte Method and a one-byte entity. I think 3-2 is better, aesthetically.

I also think it's better to avoid encoding a metasyntactic variable into the standard. "FOO" is universally used as a placeholder for user-supplied data, and it may be confusing for the spec to require implementers to send or expect the literal value "FOO". Additionally there is a legitimate chance that there are implementations in the wild that actually use "FOO" as a method, e.g. for developmental purposes.

I propose "CON" and "go" as the Method and message entity parts. I.e. 434f4e202a20485454502f322e300d0a0d0a676f0d0a0d0a or "CON * HTTP/2.0\r\n\r\ngo\r\n\r\n"

@mnot
Copy link
Member Author

mnot commented Jun 3, 2013

Hmm. "CON" is a prefix of "CONNECT"; not saying that implementations will be matching prefixes, but I get a bit worried.

On-list I proposed "STA" and "RT".

@phluid61
Copy link
Contributor

phluid61 commented Jun 3, 2013

STA works for me; I can't think of any reasons it might go wrong.

(I would die happy if it were "HELO" and ".")

grmocg added a commit that referenced this issue Aug 29, 2013
Adding just in time descriptions for different opcodes
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

2 participants