From 2359bf658b7b2c7e2d4d5012734d2f7083388ed0 Mon Sep 17 00:00:00 2001 From: Stephen Paul Weber Date: Thu, 28 Apr 2022 23:35:36 -0500 Subject: [PATCH] Headers should be case-insensitive Do not copy to a Hash, which is not case-insensitive, keep it as a headers object. --- daemon.py | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/daemon.py b/daemon.py index 02892de67..7bf6473b5 100644 --- a/daemon.py +++ b/daemon.py @@ -8,6 +8,7 @@ __status__ = "Production" __module_group__ = "Core" from http.server import BaseHTTPRequestHandler, ThreadingHTTPServer, HTTPServer +import copy import sys import json import time @@ -19390,12 +19391,9 @@ class PubServer(BaseHTTPRequestHandler): np_thread.kill() # make a copy of self.headers - headers = {} - headers_without_cookie = {} - for dict_entry_name, header_line in self.headers.items(): - headers[dict_entry_name] = header_line - if dict_entry_name.lower() != 'cookie': - headers_without_cookie[dict_entry_name] = header_line + headers = copy.deepcopy(self.headers) + headers_without_cookie = copy.deepcopy(headers) + del headers_without_cookie['cookie'] print('New post headers: ' + str(headers_without_cookie)) length = int(headers['Content-Length'])