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

Fix sanic cookies headers serialization #2194

Merged
merged 3 commits into from
Jan 15, 2025

Conversation

xrmx
Copy link
Member

@xrmx xrmx commented Jan 13, 2025

What does this pull request do?

This is a follow up of #2190 that fixes the full matrix.

We are getting a Cookie instance from Sanic that by default get translated to a dict that is not a proper type for an header. Instead convert it to its string representation.

Also use a syntax for setting cookies that work on older versions.

We are getting a Cookie instance from Sanic that by default get
translate to a dict that is not a proper type for an header. Instead
convert it to its string represantation.
@xrmx xrmx changed the title Fix sanic cookies serialization Fix sanic cookies headers serialization Jan 13, 2025
@xrmx xrmx force-pushed the fix-sanic-cookies-serialization branch from 8a56fd8 to 70d3145 Compare January 13, 2025 16:45
Copy link
Member Author

@xrmx xrmx left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/test matrix

Because it fails with:

/lib/python3.8/site-packages/sanic/helpers.py:21: in <module>
    STATUS_CODES: dict[int, bytes] = {
E   TypeError: 'type' object is not subscriptabl
@xrmx xrmx requested review from basepi and estolfo January 14, 2025 09:21
Copy link
Member Author

@xrmx xrmx left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/test matrix

@xrmx xrmx merged commit bf89ecc into elastic:main Jan 15, 2025
638 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants