D3433: httppeer: detect redirect to URL without query string (issue5860)

indygreg (Gregory Szorc) phabricator at mercurial-scm.org
Thu May 3 15:34:33 EDT 2018

indygreg added inline comments.


> mharbison72 wrote in test-http-protocol.t:361
> If this is changed to req.baseurl, it works.

The distinction between these URLs is that one uses the host:port as it actually is and the other uses the host:port as identified by the client. Since we are sending a URL back to the client, we should be using the advertised host:port.

The fact that the advertised host:port is being mangled seemingly points to a bug with the formulation of the `advertised*` variables. This is likely the result of code somewhere using `gethostname()` to populate a hostname field. I'm not sure if this is happening on the client or server. And I'm not sure why it would only be happening on Windows.

It is something to keep our eye on. But I think it is an issue in the test harness and not the hgweb code. We have unit test coverage for URL formulation in `test-wsgirequest.py` and I'm pretty confident it adheres to PEP 3333.

> mharbison72 wrote in test-http-protocol.t:375

We run `killdaemons.py` above, so overwriting `$DAEMON_PIDS` should be fine.

FWIW, I have patches queued up to change `killdaemons.py` behavior so it removes the file by default. Will send those once the 3.7 window opens.

  rHG Mercurial


To: indygreg, #hg-reviewers
Cc: mharbison72, mercurial-devel

More information about the Mercurial-devel mailing list