Check that cookie exists before removing it from headers

main
Bob Mottram 2022-05-01 10:45:37 +01:00
parent 09ea5a13e6
commit ce9bdf3c9f
1 changed files with 4 additions and 1 deletions

View File

@ -19401,7 +19401,10 @@ class PubServer(BaseHTTPRequestHandler):
# make a copy of self.headers
headers = copy.deepcopy(self.headers)
headers_without_cookie = copy.deepcopy(headers)
del headers_without_cookie['cookie']
if 'cookie' in headers_without_cookie:
del headers_without_cookie['cookie']
if 'Cookie' in headers_without_cookie:
del headers_without_cookie['Cookie']
print('New post headers: ' + str(headers_without_cookie))
length = int(headers['Content-Length'])