Fix handling of empty script name

This was revealed through testing with gabbi (to see if the
new Interceptor will work there).
This commit is contained in:
Chris Dent
2015-12-28 22:14:33 +00:00
parent ab610e1be8
commit 88cd440535
4 changed files with 4 additions and 4 deletions

View File

@@ -7,7 +7,7 @@ Interceptor
Example using `httplib2`, others are much the same:
.. testcode::
.. testcode::
import httplib2
from wsgi_intercept.interceptor import Httplib2Interceptor

View File

@@ -101,7 +101,7 @@ def test_httplib2_interceptor_https_host():
port = 443
http = Http()
with Httplib2Interceptor(app=app, host=hostname, port=port) as url:
assert url == 'https://%s/' % hostname
assert url == 'https://%s' % hostname
response, content = http.request(url)
assert response.status == 200
assert 'WSGI intercept successful!' in content.decode('utf-8')

View File

@@ -117,7 +117,7 @@ Additional documentation is available on `Read The Docs`_.
"""
from __future__ import print_function
__version__ = '0.10.3'
__version__ = '0.99.0'
import sys

View File

@@ -31,7 +31,7 @@ class Interceptor(object):
else:
self.host = host
self.port = int(port)
self.script_name = prefix or '/'
self.script_name = prefix or ''
self.url = self._url_from_primitives()
self._module = import_module('.%s' % self.MODULE_NAME,