main
Bob Mottram 2021-07-12 10:41:04 +01:00
parent 94fb8e5c81
commit 13ba1565fa
1 changed files with 10 additions and 9 deletions

View File

@ -621,6 +621,16 @@ class PubServer(BaseHTTPRequestHandler):
'title="Login to Epicyon", Basic realm="epicyon"')
self.end_headers()
def _quoted_redirect(self, redirect: str) -> str:
"""hashtags sometimes contain non-ascii characters which
need to be url encoded
"""
if '/tags/' not in redirect:
return redirect
lastStr = redirect.split('/')[-1]
return redirect.replace('/' + lastStr, '/' +
urllib.parse.quote_plus(lastStr))
def _logout_redirect(self, redirect: str, cookie: str,
callingDomain: str) -> None:
if '://' not in redirect:
@ -713,15 +723,6 @@ class PubServer(BaseHTTPRequestHandler):
return True
return False
def _quoted_redirect(self, redirect: str) -> str:
"""URL encodes any non-ascii characters for url redirects
"""
if '/tags/' not in redirect:
return redirect
lastStr = redirect.split('/')[-1]
return redirect.replace('/' + lastStr, '/' +
urllib.parse.quote_plus(lastStr))
def _redirect_headers(self, redirect: str, cookie: str,
callingDomain: str) -> None:
if '://' not in redirect: