Skip to content

Commit 3446b55

Browse files
authored
Quote proxied_path to make it a safe URL (fixes #138)
1 parent 80263c5 commit 3446b55

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

jupyter_server_proxy/handlers.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
import inspect
88
import socket
99
import os
10-
from urllib.parse import urlunparse, urlparse
10+
from urllib.parse import urlunparse, urlparse, quote
1111
import aiohttp
1212
from asyncio import Lock
1313

@@ -155,7 +155,7 @@ def _build_proxy_request(self, host, port, proxied_path, body):
155155

156156
headers = self.proxy_request_headers()
157157

158-
client_uri = self.get_client_uri('http', host, port, proxied_path)
158+
client_uri = self.get_client_uri('http', host, port, quote(proxied_path))
159159
# Some applications check X-Forwarded-Context and X-ProxyContextPath
160160
# headers to see if and where they are being proxied from.
161161
if not self.absolute_url:

0 commit comments

Comments
 (0)