mirror of
https://gitlab.com/bashrc2/epicyon
synced 2026-10-31 10:01:48 +00:00
Comment
This commit is contained in:
1 parent
94fb8e5c81
commit
13ba1565fa
1 file changed
+10
-9
@@ -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:
|
||||
|
||||
Reference in new issue
Block a user