( )⚙ D2744 hgweb: handle CONTENT_LENGTH

This is an archive of the discontinued Mercurial Phabricator instance.

hgweb: handle CONTENT_LENGTH
ClosedPublic

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

Details

Summary

PEP 3333 says CONTENT_LENGTH may be set. I /think/ WSGI servers are
allowed to invent this key even if the client didn't send it.

We had code in wireprotoserver looking for this key. So let's
just automagically convert this key to an HTTP request header
when parsing the request.

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 accepted this revision.Mar 9 2018, 5:14 PM
durin42 added a subscriber: durin42.
durin42 added inline comments.
mercurial/wireprotoserver.py
94–96

For our clients it always will, because we precompute the bundle to a file. It's gross.

This revision is now accepted and ready to land.Mar 9 2018, 5:14 PM
indygreg edited the summary of this revision. (Show Details)Mar 10 2018, 3:03 PM
indygreg updated this revision to Diff 6824.
mharbison72 added inline comments.
mercurial/hgweb/request.py
205

typo: "... will either either value..."

durin42 accepted this revision.Mar 12 2018, 4:52 PM
This revision was automatically updated to reflect the committed changes.