Url parsing

main
Bob Mottram 2020-04-15 12:10:30 +01:00
parent 167b7926fd
commit e6991c8ac0
2 changed files with 3 additions and 4 deletions

View File

@ -14,6 +14,7 @@ except ImportError:
from Crypto.PublicKey import RSA
from Crypto.Util import number
import os
import urllib.parse
from session import getJson
from cache import storeWebfingerInCache
from cache import getWebfingerFromCache
@ -220,8 +221,7 @@ def webfingerLookup(path: str, baseDir: str,
else:
if 'resource=acct%3A' in path:
handle = path.split('resource=acct%3A')[1]
handle = handle.replace('%40', '@', 1)
handle = handle.replace('%3A', ':', 1).strip()
handle = urllib.parse.unquote(handle.strip())
if debug:
print('DEBUG: WEBFINGER handle ' + handle)
if not handle:

View File

@ -273,8 +273,7 @@ def htmlSearchSharedItems(translate: {},
currPage = 1
ctr = 0
sharedItemsForm = ''
searchStrLower = searchStr.replace('%2B', '+').replace('%40', '@')
searchStrLower = searchStrLower.replace('%3A', ':').replace('%23', '#')
searchStrLower = urllib.parse.unquote(searchStr)
searchStrLower = searchStrLower.lower().strip('\n')
searchStrLowerList = searchStrLower.split('+')
cssFilename = baseDir + '/epicyon-profile.css'