Permalink
Browse files

Revert "Clean up URL to eliminate double slashes when templating."

This reverts commit 11b39f2.

Why: breaks URL handling because it applies to the scheme (http:// etc)
  • Loading branch information...
1 parent 2884f2f commit d20df16e4ad29335f2ae1e3c516987aa34368197 @svanoort committed Mar 30, 2016
Showing with 4 additions and 9 deletions.
  1. +4 −9 pyresttest/tests.py
View
@@ -180,11 +180,6 @@ def get_url(self, context=None):
val = self.realize_template(self.NAME_URL, context)
if val is None:
val = self._url
- else:
- url_parts = [part for part in val.split('/') if part != '']
- if val.endswith('/'):
- url_parts.append(' ')
- val = '/'.join(url_parts).strip()
return val
url = property(get_url, set_url, None, 'URL fragment for request')
@@ -298,14 +293,14 @@ def configure_curl(self, timeout=DEFAULT_TIMEOUT, context=None, curl_handle=None
curl = curl_handle
try: # Check the curl handle isn't closed, and reuse it if possible
- curl.getinfo(curl.HTTP_CODE)
+ curl.getinfo(curl.HTTP_CODE)
# Below clears the cookies & curl options for clean run
# But retains the DNS cache and connection pool
curl.reset()
curl.setopt(curl.COOKIELIST, "ALL")
except pycurl.error:
curl = pycurl.Curl()
-
+
else:
curl = pycurl.Curl()
@@ -324,8 +319,8 @@ def configure_curl(self, timeout=DEFAULT_TIMEOUT, context=None, curl_handle=None
curl.setopt(curl.READFUNCTION, MyIO(bod).read)
if self.auth_username and self.auth_password:
- curl.setopt(pycurl.USERPWD,
- parsing.encode_unicode_bytes(self.auth_username) + b':' +
+ curl.setopt(pycurl.USERPWD,
+ parsing.encode_unicode_bytes(self.auth_username) + b':' +
parsing.encode_unicode_bytes(self.auth_password))
if self.auth_type:
curl.setopt(pycurl.HTTPAUTH, self.auth_type)

0 comments on commit d20df16

Please sign in to comment.