mirror of https://gitlab.com/bashrc2/epicyon
Handle @ paths with status number
parent
5257cfe2c8
commit
7f8b55a62e
10
daemon.py
10
daemon.py
|
@ -10051,6 +10051,16 @@ class PubServer(BaseHTTPRequestHandler):
|
||||||
# replace https://domain/@nick with https://domain/users/nick
|
# replace https://domain/@nick with https://domain/users/nick
|
||||||
if self.path.startswith('/@'):
|
if self.path.startswith('/@'):
|
||||||
self.path = self.path.replace('/@', '/users/')
|
self.path = self.path.replace('/@', '/users/')
|
||||||
|
# replace https://domain/@nick/statusnumber
|
||||||
|
# with https://domain/users/nick/statuses/statusnumber
|
||||||
|
nickname = self.path.split('/users/')[1]
|
||||||
|
if '/' in nickname:
|
||||||
|
statusNumberStr = nickname.split('/')[1]
|
||||||
|
if statusNumberStr.isdigit():
|
||||||
|
nickname = nickname.split('/')[0]
|
||||||
|
self.path = \
|
||||||
|
self.path.replace('/users/' + nickname + '/',
|
||||||
|
'/users/' + nickname + '/statuses/')
|
||||||
|
|
||||||
# turn off dropdowns on new post screen
|
# turn off dropdowns on new post screen
|
||||||
noDropDown = False
|
noDropDown = False
|
||||||
|
|
Loading…
Reference in New Issue