This is an archive of the discontinued Mercurial Phabricator instance.

wireprotoserver: access headers through parsed request
ClosedPublic

Authored by indygreg on Mar 8 2018, 8:06 PM.

Details

Summary

Now that we can access headers via the parsed request object, let's
do that.

Since the new object uses bytes, hyphens, and is case-insensitive, a
bit of code around normalizing values has been removed. I think
the new code is much more intuitive because it more closely matches
what is going out over the wire.

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 8 2018, 8:06 PM
durin42 added a subscriber: durin42.Mar 9 2018, 2:26 PM
durin42 added inline comments.
mercurial/wireprotoserver.py
97

Missed one?

indygreg added inline comments.Mar 9 2018, 6:10 PM
mercurial/wireprotoserver.py
97

No. This preserves the behavior since HTTP_CONTENT_LENGTH != CONTENT_LENGTH. I fix this in a later commit by teaching the request object about both keys.

durin42 accepted this revision.Mar 12 2018, 4:48 PM
This revision is now accepted and ready to land.Mar 12 2018, 4:48 PM
This revision was automatically updated to reflect the committed changes.