Removing posts

main
Bob Mottram 2020-10-19 11:33:02 +01:00
parent 47c2a592b0
commit de62b155d9
1 changed files with 14 additions and 6 deletions

View File

@ -11456,7 +11456,14 @@ class PubServer(BaseHTTPRequestHandler):
self._benchmarkPOSTtimings(POSTstartTime, POSTtimings, 7) self._benchmarkPOSTtimings(POSTstartTime, POSTtimings, 7)
if authorized: if not authorized:
if self.path.endswith('/rmpost'):
print('ERROR: attempt to remove post was not authorized. ' +
self.path)
self._400()
self.server.POSTbusy = False
return
else:
# a vote/question/poll is posted # a vote/question/poll is posted
if self.path.endswith('/question') or \ if self.path.endswith('/question') or \
'/question?page=' in self.path: '/question?page=' in self.path:
@ -11488,11 +11495,12 @@ class PubServer(BaseHTTPRequestHandler):
# removes a post # removes a post
if self.path.endswith('/rmpost'): if self.path.endswith('/rmpost'):
print('ERROR: attempt to remove post was not authorized. ' + if '/users/' not in self.path:
self.path) print('ERROR: attempt to remove post was not authorized. ' +
self._400() self.path)
self.server.POSTbusy = False self._400()
return self.server.POSTbusy = False
return
if self.path.endswith('/rmpost'): if self.path.endswith('/rmpost'):
self._removePost(callingDomain, cookie, self._removePost(callingDomain, cookie,
authorized, self.path, authorized, self.path,