Details
Details
- Reviewers
yuja - Group Reviewers
hg-reviewers - Commits
- rHG9c3dcaf648ef: httppeer: convert request url back to bytes before inspecting it
Diff Detail
Diff Detail
- Repository
- rHG Mercurial
- Lint
Lint Skipped - Unit
Unit Tests Skipped
yuja |
hg-reviewers |
Lint Skipped |
Unit Tests Skipped |
self.ui.debug('http error while sending %s command\n' % cmd) | self.ui.debug('http error while sending %s command\n' % cmd) | ||||
self.ui.traceback() | self.ui.traceback() | ||||
raise IOError(None, inst) | raise IOError(None, inst) | ||||
# Insert error handlers for common I/O failures. | # Insert error handlers for common I/O failures. | ||||
_wraphttpresponse(resp) | _wraphttpresponse(resp) | ||||
# record the url we got redirected to | # record the url we got redirected to | ||||
resp_url = resp.geturl() | resp_url = pycompat.bytesurl(resp.geturl()) | ||||
if resp_url.endswith(qs): | if resp_url.endswith(qs): | ||||
resp_url = resp_url[:-len(qs)] | resp_url = resp_url[:-len(qs)] | ||||
if self._url.rstrip('/') != resp_url.rstrip('/'): | if self._url.rstrip('/') != resp_url.rstrip('/'): | ||||
if not self.ui.quiet: | if not self.ui.quiet: | ||||
self.ui.warn(_('real URL is %s\n') % resp_url) | self.ui.warn(_('real URL is %s\n') % resp_url) | ||||
self._url = resp_url | self._url = resp_url | ||||
try: | try: | ||||
proto = resp.getheader('content-type') | proto = resp.getheader('content-type') |