From 0c3453815c5834fe24cad3013172a1a08082d45a Mon Sep 17 00:00:00 2001 From: Witekkq Date: Thu, 8 Nov 2018 10:34:06 +0100 Subject: [PATCH] fixed issue 188,trailing spaces not allowed in header (#194) --- starlette/responses.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/starlette/responses.py b/starlette/responses.py index 5433194d..3f5edd8a 100644 --- a/starlette/responses.py +++ b/starlette/responses.py @@ -107,7 +107,7 @@ class Response: cookie[key]["secure"] = True # type: ignore if httponly: cookie[key]["httponly"] = True # type: ignore - cookie_val = cookie.output(header="") + cookie_val = cookie.output(header="").strip() self.raw_headers.append((b"set-cookie", cookie_val.encode("latin-1"))) def delete_cookie(self, key: str, path: str = "/", domain: str = None) -> None: