@@ -239,7 +239,7 @@ async def proxy(self, port, proxied_path):
239239 # headers to see if and where they are being proxied from. We set
240240 # them to be {base_url}/proxy/{port}.
241241 headers ['X-Forwarded-Context' ] = headers ['X-ProxyContextPath' ] = \
242- url_path_join (self .base_url , 'proxy' , port )
242+ url_path_join (self .base_url , 'proxy' , str ( port ) )
243243
244244 req = httpclient .HTTPRequest (
245245 client_uri , method = self .request .method , body = body ,
@@ -262,7 +262,7 @@ async def proxy(self, port, proxied_path):
262262
263263 for header , v in response .headers .get_all ():
264264 if header not in ('Content-Length' , 'Transfer-Encoding' ,
265- 'Content-Encoding' , 'Connection' ):
265+ 'Content-Encoding' , 'Connection' ):
266266 # some header appear multiple times, eg 'Set-Cookie'
267267 self .add_header (header , v )
268268
@@ -482,6 +482,7 @@ def patch(self, path):
482482 def options (self , path ):
483483 return self .proxy (self .port , path )
484484
485+
485486def setup_handlers (web_app ):
486487 host_pattern = '.*$'
487488 web_app .add_handlers ('.*' , [
0 commit comments