Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Content app throws error when receiving cookie it can't handle #6214

Open
daviddavis opened this issue Jan 16, 2025 · 0 comments
Open

Content app throws error when receiving cookie it can't handle #6214

daviddavis opened this issue Jan 16, 2025 · 0 comments

Comments

@daviddavis
Copy link
Contributor

daviddavis commented Jan 16, 2025

Steps to reproduce:

curl --cookie "{=1" ${PULP_CONTENT_URL}/pulp/content/
500 Internal Server Error

Stacktrace:

2025-01-16T14:43:37Z Traceback (most recent call last):
2025-01-16T14:43:37Z  File "/venv/lib/python3.9/site-packages/aiohttp/web_protocol.py", line 480, in _handle_request
2025-01-16T14:43:37Z    resp = await request_handler(request)
2025-01-16T14:43:37Z  File "/venv/lib/python3.9/site-packages/aiohttp/web_app.py", line 569, in _handle
2025-01-16T14:43:37Z    return await handler(request)
2025-01-16T14:43:37Z  File "/venv/lib/python3.9/site-packages/aiohttp/web_middlewares.py", line 117, in impl
2025-01-16T14:43:37Z    return await handler(request)
2025-01-16T14:43:37Z  File "/venv/lib/python3.9/site-packages/pulpcore/content/authentication.py", line 23, in authenticate
2025-01-16T14:43:37Z    django_request = convert_request(request)
2025-01-16T14:43:37Z  File "/venv/lib/python3.9/site-packages/pulpcore/content/authentication.py", line 63, in convert_request
2025-01-16T14:43:37Z    djr.COOKIES = request.cookies
2025-01-16T14:43:37Z  File "src/propcache/_helpers_c.pyx", line 33, in propcache._helpers_c.under_cached_property.__get__
2025-01-16T14:43:37Z  File "/venv/lib/python3.9/site-packages/aiohttp/web_request.py", line 595, in cookies
2025-01-16T14:43:37Z    parsed = SimpleCookie(raw)
2025-01-16T14:43:37Z  File "/usr/lib/python3.9/http/cookies.py", line 465, in __init__
2025-01-16T14:43:37Z    self.load(input)
2025-01-16T14:43:37Z  File "/usr/lib/python3.9/http/cookies.py", line 514, in load
2025-01-16T14:43:37Z    self.__parse_string(rawdata)
2025-01-16T14:43:37Z  File "/usr/lib/python3.9/http/cookies.py", line 578, in __parse_string
2025-01-16T14:43:37Z    self.__set(key, rval, cval)
2025-01-16T14:43:37Z  File "/usr/lib/python3.9/http/cookies.py", line 470, in __set
2025-01-16T14:43:37Z    M.set(key, real_value, coded_value)
2025-01-16T14:43:37Z  File "/usr/lib/python3.9/http/cookies.py", line 335, in set
2025-01-16T14:43:37Z    raise CookieError('Illegal key %r' % (key,))
2025-01-16T14:43:37Z http.cookies.CookieError: Illegal key '{'

I think pulp would just ignore the cookie or return some sort of 4xx response.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant