forked from indymedia/epicyon
replace /@
parent
eaba779cc1
commit
c94b348f8d
17
daemon.py
17
daemon.py
|
@ -487,6 +487,17 @@ class PubServer(BaseHTTPRequestHandler):
|
||||||
self.server.session= \
|
self.server.session= \
|
||||||
createSession(self.server.domain,self.server.port,self.server.useTor)
|
createSession(self.server.domain,self.server.port,self.server.useTor)
|
||||||
|
|
||||||
|
# is this a html request?
|
||||||
|
htmlGET=False
|
||||||
|
if self.headers.get('Accept'):
|
||||||
|
if 'text/html' in self.headers['Accept']:
|
||||||
|
htmlGET=True
|
||||||
|
|
||||||
|
# replace https://domain/@nick with https://domain/users/nick
|
||||||
|
if htmlGET and '/@' in self.path and \
|
||||||
|
(self.path.startswith('http') or self.path.startswith('dat')):
|
||||||
|
self.path=self.path.replace('/@','/users/')
|
||||||
|
|
||||||
# treat shared inbox paths consistently
|
# treat shared inbox paths consistently
|
||||||
if self.path=='/sharedInbox' or \
|
if self.path=='/sharedInbox' or \
|
||||||
self.path=='/users/inbox' or \
|
self.path=='/users/inbox' or \
|
||||||
|
@ -494,12 +505,6 @@ class PubServer(BaseHTTPRequestHandler):
|
||||||
self.path=='/users/'+self.server.domain:
|
self.path=='/users/'+self.server.domain:
|
||||||
self.path='/inbox'
|
self.path='/inbox'
|
||||||
|
|
||||||
# is this a html request?
|
|
||||||
htmlGET=False
|
|
||||||
if self.headers.get('Accept'):
|
|
||||||
if 'text/html' in self.headers['Accept']:
|
|
||||||
htmlGET=True
|
|
||||||
|
|
||||||
# Unfollow a person from the web interface by selecting Unfollow on the dropdown
|
# Unfollow a person from the web interface by selecting Unfollow on the dropdown
|
||||||
if htmlGET and '/users/' in self.path and '?unfollow=' in self.path:
|
if htmlGET and '/users/' in self.path and '?unfollow=' in self.path:
|
||||||
followStr=self.path.split('?unfollow=')[1]
|
followStr=self.path.split('?unfollow=')[1]
|
||||||
|
|
Loading…
Reference in New Issue