mirror of
https://github.com/kennethreitz/requests.git
synced 2026-06-05 22:50:18 +00:00
Fix #1293
This commit is contained in:
+4
-1
@@ -284,9 +284,12 @@ class PreparedRequest(RequestEncodingMixin, RequestHooksMixin):
|
||||
# Support for unicode domain names and paths.
|
||||
scheme, netloc, path, _params, query, fragment = urlparse(url)
|
||||
|
||||
if not (scheme and netloc):
|
||||
if not scheme:
|
||||
raise MissingSchema("Invalid URL %r: No schema supplied" % url)
|
||||
|
||||
if not netloc:
|
||||
raise InvalidURL("Invalid URL %t: No netloc supplied" % url)
|
||||
|
||||
try:
|
||||
netloc = netloc.encode('idna').decode('utf-8')
|
||||
except UnicodeError:
|
||||
|
||||
Reference in New Issue
Block a user