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

_unquote received cookie values #196

Merged
merged 1 commit into from
Dec 30, 2023
Merged

_unquote received cookie values #196

merged 1 commit into from
Dec 30, 2023

Conversation

hlohaus
Copy link
Contributor

@hlohaus hlohaus commented Dec 28, 2023

No description provided.

@hlohaus
Copy link
Contributor Author

hlohaus commented Dec 28, 2023

async def run_async():
    async with StreamSession() as session:
        async with session.get("https://httpbin.org/cookies/set/test/;") as response:
            response.raise_for_status()
        async with session.get("https://httpbin.org/headers", cookies={"test2": ";"}) as response:
            print(await response.text())

asyncio.run(run_async())

with fix:

{
  "headers": {
    "Accept": "*/*", 
    "Accept-Encoding": "gzip, deflate, br", 
    "Cookie": "test2=;; test=;", 
    "Host": "httpbin.org", 
    "X-Amzn-Trace-Id": "Root=1-658d99f2-20a0e91a0f976a473a0ff84d"
  }
}

without fix:

{
  "headers": {
    "Accept": "*/*", 
    "Accept-Encoding": "gzip, deflate, br", 
    "Cookie": "test2=hello2; test=\"\\073\"", 
    "Host": "httpbin.org", 
    "X-Amzn-Trace-Id": "Root=1-658d9984-543c3106592aea7d519449d9"
  }
}

we need this fix for bing.com
; is a bad example, but also = have this issue

@perklet perklet merged commit dd4635b into lexiforest:main Dec 30, 2023
3 checks passed
@hlohaus hlohaus deleted the cookie branch January 15, 2024 08:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants