mirror of
https://github.com/jupyterhub/jupyterhub.git
synced 2025-10-19 07:53:00 +00:00
Escape named servers when used in URL paths
This commit is contained in:
@@ -19,6 +19,7 @@ from binascii import b2a_hex
|
||||
from datetime import datetime, timezone
|
||||
from hmac import compare_digest
|
||||
from operator import itemgetter
|
||||
from urllib.parse import quote
|
||||
|
||||
from async_generator import aclosing
|
||||
from sqlalchemy.exc import SQLAlchemyError
|
||||
@@ -371,6 +372,11 @@ def compare_token(compare, token):
|
||||
return False
|
||||
|
||||
|
||||
def url_escape_path(value):
|
||||
"""Escape a value to be used in URLs, cookies, etc."""
|
||||
return quote(value, safe='@~')
|
||||
|
||||
|
||||
def url_path_join(*pieces):
|
||||
"""Join components of url into a relative url.
|
||||
|
||||
|
Reference in New Issue
Block a user