( )⚙ D2850 wireproto: define content negotiation for HTTPv2

This is an archive of the discontinued Mercurial Phabricator instance.

wireproto: define content negotiation for HTTPv2
ClosedPublic

Authored by indygreg on Mar 13 2018, 9:16 PM.

Details

Summary

HTTP messages communicate their media types and what media types
they can understand via the Content-Type and Accept header,
respectively.

While I don't want the wire protocol to lean too heavily on HTTP
because I'm aiming for the wire protocol to be as transport
agnostic as possible, it is nice to play by the spec if possible.

This commit defines our media negotiation mechanism for version
2 of the HTTP protocol. Essentially, we mandate the use of a
new media type and how clients and servers should react to
various headers or lack thereof.

The name of the media type is a placeholder. We purposefully don't
yet define the format of the new media type because that's a lot
of work.

I feel pretty strongly that we should use Content-Type. I feel
less strongly about Accept. I think it is reasonable for servers
to return the media type that was submitted to them. So we may
strike this header before the protocol is finished...

Diff Detail

Repository
rHG Mercurial
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.

Event Timeline

indygreg created this revision.Mar 13 2018, 9:16 PM
indygreg updated this revision to Diff 7138.Mar 19 2018, 7:59 PM
durin42 accepted this revision.Mar 21 2018, 3:18 PM
This revision is now accepted and ready to land.Mar 21 2018, 3:18 PM
indygreg updated this revision to Diff 7198.Mar 21 2018, 6:19 PM
durin42 accepted this revision.Mar 21 2018, 6:22 PM
This revision was automatically updated to reflect the committed changes.
yuja added a subscriber: yuja.Mar 24 2018, 9:31 AM

We might have to handle multiple Accept headers correctly, if a proxy
server MAY modify them. I don't know if that could happen, though.