This is an archive of the discontinued Mercurial Phabricator instance.

hgweb: parse and store POST form data
AbandonedPublic

Authored by indygreg on Mar 9 2018, 8:23 PM.

Details

Reviewers
None
Group Reviewers
hg-reviewers
Summary

This is essentially a port of what wsgirequest.init was doing
inline via cgi.parse().

Our version is better because - unlike cgi.parse() - we keep the
query string and POST data separate. We do still expose a unified
dict for convenience, however. But consumers can now be explicit
about whether a parameter should be fetched from the query string
or form data.

Because we can only read from POST data once, we had to support
passing in previously resolved values to support hgwebdir's ugly
hack of having to construct a new parsedrequest type.

The only consumer we update to use the new API is wsgirequest.

Also, the normalization of values is explicitly not performed in
the new code. This is because the intent of our request object is
to represent the raw request with minimal transformation.

With this commit, all meaningful request components are now
reflected on our parsedrequest type!

Diff Detail

Repository
rHG Mercurial
Lint
Lint Skipped
Unit
Unit Tests Skipped