From 1cc99412bca5b5009ee6b3c087e5eb5d45f3d290 Mon Sep 17 00:00:00 2001 From: Joe Kaufeld Date: Sun, 22 Sep 2024 19:02:57 -0400 Subject: [PATCH] :bug: fix header assignment bug --- spiderweb/response.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/spiderweb/response.py b/spiderweb/response.py index 0e79648..44ffa0b 100644 --- a/spiderweb/response.py +++ b/spiderweb/response.py @@ -29,8 +29,10 @@ class HttpResponse: self.data = data self.context = context if context else {} self.status_code = status_code - self.headers = headers if headers else {} - self.headers = Headers(**{k.lower(): v for k, v in self.headers.items()}) + self._headers = headers if headers else {} + self.headers = Headers() + for k, v in self._headers.items(): + self.headers[k.lower()] = v if not self.headers.get("content-type"): self.headers["content-type"] = "text/html; charset=utf-8" self.headers["server"] = "Spiderweb"