This is an archive of the discontinued Mercurial Phabricator instance.

hgweb: use parsed request to construct query parameters
ClosedPublic

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

Details

Summary

The way hgweb routes requests is kind of bonkers. If PATH_INFO is
set, we take the URL path after the repository. Otherwise, we take
the first part of the query string before "&" and the part before
";" in that.

We then kinda/sorta treat this as a path and route based on that.

This commit ports that code to use the parsed request object. This
required a new attribute on the parsed request to indicate whether
there is any PATH_INFO.

The new code still feels a bit convoluted for my liking. But we'll
need to rewrite more of the code before a better solution becomes
apparant. This code feels strictly better since we're no longer
doing low-level WSGI manipulation during routing.

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, 2:04 PM
This revision is now accepted and ready to land.Mar 9 2018, 2:04 PM
This revision was automatically updated to reflect the committed changes.