Message393539
Simple example to reproduce the issue:
from http import cookies
C = cookies.SimpleCookie()
C["ys-api/mpegts/service"] = "blabla"
print(C.output())
@ra1nb0w so far as I have found [1][2], the "/" not a valid character for the Cookie name, [3] defines the list of valid characters and [4] is where the exception is raised, I also found that even with the RFC browsers have different rules for the Cookie name definitions, this could be reason why Python has, for example, the ":" character in the list.
My conclusion is that the rule for the cookie name is not well-defined, there are some ambiguities here and there, but if we consider purely this case and the RFC, the "/" still is not a valid character for the cookie name, so I guess the best option for you is to filter it out any http.cookies.CookieError that happen.
[1] https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Set-Cookie#attributes
[2] https://datatracker.ietf.org/doc/html/rfc2616#section-2.2
[3] https://github.com/python/cpython/blob/main/Lib/http/cookies.py#L162
[4] https://github.com/python/cpython/blob/main/Lib/http/cookies.py#L353 |
|
Date |
User |
Action |
Args |
2021-05-12 17:57:38 | jaswdr | set | recipients:
+ jaswdr, ra1nb0w |
2021-05-12 17:57:38 | jaswdr | set | messageid: <1620842258.76.0.439860089121.issue44104@roundup.psfhosted.org> |
2021-05-12 17:57:38 | jaswdr | link | issue44104 messages |
2021-05-12 17:57:38 | jaswdr | create | |
|