I made a fix which renders cookies correctly in request header.
In the previous code cookie_jar.output(headers="") was rendering cookies as for Set-Cookie response header, which means that additional flags like Expires, Max-Age, SameSite etc was added.
Why it was working?
Because both tested framework - Quart and Starlette, in versions specified in requirements, uses same library and SimpleCookie to parse this header. So even with Set-Cookie syntax in the header, all tests were passing as SimpleCookie.load method supports both: Cookie and Set-Cookie
However, Starlette in the current version has custom cookie parsing mechanism and updating starlette cause tests failing.
What has been changed
I've changed Cookie request header rendering, so only cookie name and value are rendered now. Also multiple cookies are correctly separated by ; not \r\n.
I've add a new /cookie-raw endpoint in both frameworks to make sure that Cookie header seen by the asgi app is correct. I was NOT updating Starlette.
I made a fix which renders cookies correctly in request header. In the previous code
cookie_jar.output(headers="")
was rendering cookies as forSet-Cookie
response header, which means that additional flags likeExpires
,Max-Age
,SameSite
etc was added.Why it was working?
Because both tested framework - Quart and Starlette, in versions specified in requirements, uses same library and SimpleCookie to parse this header. So even with Set-Cookie syntax in the header, all tests were passing as SimpleCookie.load method supports both:
Cookie
andSet-Cookie
However, Starlette in the current version has custom cookie parsing mechanism and updating starlette cause tests failing.
What has been changed
I've changed
Cookie
request header rendering, so only cookie name and value are rendered now. Also multiple cookies are correctly separated by;
not\r\n
. I've add a new/cookie-raw
endpoint in both frameworks to make sure thatCookie
header seen by the asgi app is correct. I was NOT updating Starlette.This PR closes https://github.com/vinissimus/async-asgi-testclient/issues/41