Skip to content
Myr

Use urljoin instead of manual concatenation.

Before adoption: this commit came in with the history the project adopted, so no landing records it.

authored by Jérémy Bethmont · committed by Jérémy Bethmont · parent aa0f78b · Browse files · 1 file+2 added−3 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

1 file+2 added−3 removed

  • other:+2 added−3 removed

1 file+2 added−3 removed

modified:requests/models.py+2 added-3 removed
10 unmodified lines
11import socket12import zlib1314from urllib2 import HTTPError15from urlparse import urlparse, urlunparse15from urlparse import urlparse, urlunparse, urljoin16from datetime import datetime1718from .config import settings19from .monkeys import Request as _Request, HTTPBasicAuthHandler, HTTPForcedBasicAuthHandler, HTTPDigestAuthHandler, HTTPRedirectHandler
177 unmodified lines
197198 # Facilitate non-RFC2616-compliant 'location' headers199 # (e.g. '/path/to/resource' instead of 'http://domain.tld/path/to/resource')200 if not urlparse(url).netloc:201 parent_url_components = urlparse(self.url)202 url = '%s://%s/%s' % (parent_url_components.scheme, parent_url_components.netloc, urllib.quote(urllib.unquote(url)))201 url = urljoin(r.url, urllib.quote(urllib.unquote(url)))202203 # http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.3.4204 if r.status_code is 303:205 method = 'GET'
363 unmodified lines