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:
@@ -7,7 +7,7 @@ Interceptor
|
||||
|
||||
Example using `httplib2`, others are much the same:
|
||||
|
||||
.. testcode::
|
||||
.. testcode::
|
||||
|
||||
import httplib2
|
||||
from wsgi_intercept.interceptor import Httplib2Interceptor
|
||||
|
||||
@@ -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')
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user