Variable name

merge-requests/30/head
Bob Mottram 2021-08-12 15:16:13 +01:00
parent a9d10593f2
commit a6149853ca
3 changed files with 6 additions and 17 deletions

View File

@ -683,17 +683,12 @@ class PubServer(BaseHTTPRequestHandler):
def _set_headers_base(self, fileFormat: str, length: int, cookie: str,
callingDomain: str, permissive: bool) -> None:
self.send_response(200)
if permissive:
# use lower case
self.send_header('content-type', fileFormat)
if length > -1:
self.send_header('content-length', str(length))
self.send_header('host', callingDomain)
return
self.send_header('Content-type', fileFormat)
if length > -1:
self.send_header('Content-Length', str(length))
self.send_header('Host', callingDomain)
if permissive:
return
if cookie:
cookieStr = cookie
if 'HttpOnly;' not in cookieStr:
@ -718,9 +713,6 @@ class PubServer(BaseHTTPRequestHandler):
self._set_headers_base(fileFormat, length, None, callingDomain,
permissive)
if etag:
if permissive:
self.send_header('etag', '"' + etag + '"')
else:
self.send_header('ETag', '"' + etag + '"')
self.end_headers()
@ -746,9 +738,6 @@ class PubServer(BaseHTTPRequestHandler):
except BaseException:
pass
if etag:
if permissive:
self.send_header('etag', '"' + etag + '"')
else:
self.send_header('ETag', '"' + etag + '"')
if lastModified:
self.send_header('last-modified', lastModified)

View File

@ -1501,7 +1501,7 @@ def _deleteConversationPost(baseDir: str, nickname: str, domain: str,
conversationId = postJsonObject['object']['conversation']
conversationId = conversationId.replace('/', '#')
postId = postJsonObject['object']['id']
conversationFilename = conversationDir + '/' + conversation
conversationFilename = conversationDir + '/' + conversationId
if not os.path.isfile(conversationFilename):
return False
conversationStr = ''