This is an archive of the discontinued Mercurial Phabricator instance.

hgweb: teach WSGI parser about query strings
ClosedPublic

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

Details

Summary

Currently, req.form uses cgi.parse() to populate form data. Depending
on the request, form data can come from POST multipart/form-data,
application/x-www-form-urlencoded, or the URL query string.

Putting all these things into one data structure makes it difficult
to reason about how exactly parameters got to the request. It can
lead to wonkiness such as pulling parameters from both the URL and
POST data.

This commit teaches our WSGI request parser about argument data
in query strings. We populate fields containing the query string
data and only the query string data so it can't be confused with
POST data.

Diff Detail

Repository
rHG Mercurial
Lint
Lint Skipped
Unit
Unit Tests Skipped

Event Timeline

indygreg created this revision.Mar 8 2018, 8:06 PM
durin42 accepted this revision.Mar 9 2018, 2:02 PM
This revision is now accepted and ready to land.Mar 9 2018, 2:02 PM
This revision was automatically updated to reflect the committed changes.