mirror of
https://github.com/kennethreitz/requests.git
synced 2026-06-05 22:50:18 +00:00
fix problem with path being double escaped
This commit is contained in:
+2
-2
@@ -351,8 +351,8 @@ class Request(object):
|
||||
if not path:
|
||||
path = '/'
|
||||
|
||||
# if is_py3:
|
||||
path = quote(path.encode('utf-8'))
|
||||
if is_py3:
|
||||
path = quote(path.encode('utf-8'))
|
||||
|
||||
url.append(path)
|
||||
|
||||
|
||||
@@ -72,6 +72,12 @@ class RequestsTestSuite(TestSetup, unittest.TestCase):
|
||||
def test_invalid_url(self):
|
||||
self.assertRaises(ValueError, get, 'hiwpefhipowhefopw')
|
||||
|
||||
|
||||
def test_path_is_not_double_encoded(self):
|
||||
request = requests.Request("http://0.0.0.0/get/~test")
|
||||
|
||||
assert request.path_url == "/get/%7Etest"
|
||||
|
||||
def test_HTTP_200_OK_GET(self):
|
||||
r = get(httpbin('/get'))
|
||||
self.assertEqual(r.status_code, 200)
|
||||
|
||||
Reference in New Issue
Block a user