🐛 fix header assignment bug

This commit is contained in:
Joe Kaufeld 2024-09-22 19:02:57 -04:00
parent 65dfa9d599
commit 1cc99412bc

View File

@ -29,8 +29,10 @@ class HttpResponse:
self.data = data self.data = data
self.context = context if context else {} self.context = context if context else {}
self.status_code = status_code self.status_code = status_code
self.headers = headers if headers else {} self._headers = headers if headers else {}
self.headers = Headers(**{k.lower(): v for k, v in self.headers.items()}) self.headers = Headers()
for k, v in self._headers.items():
self.headers[k.lower()] = v
if not self.headers.get("content-type"): if not self.headers.get("content-type"):
self.headers["content-type"] = "text/html; charset=utf-8" self.headers["content-type"] = "text/html; charset=utf-8"
self.headers["server"] = "Spiderweb" self.headers["server"] = "Spiderweb"