-
-
Notifications
You must be signed in to change notification settings - Fork 62
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
♻️ Refactor header option parser to use the standard library instead of a custom RegEx #75
Conversation
Hey @Kludex, random question but could I ask you to make a security advisory for Given that the issue discussed in the PR above is fundamentally rooted in this project we think it would be ideal if you would be willing to make an advisory 🙇 |
I can't create advisories in this repository. I'm not the owner. |
I'll email the owner, and ask to be transferred. |
Thank you much and sorry to bug 🙇 |
@darakian I'll create the advisory here today. Do you know if advisories can be deleted from other repositories e.g. FastAPI and Starlette? |
They cannot. The best thing to do with those (IMO) is to make them specifically about which versions bundled the affected versions of |
It seems that this change broke parsing of extended syntax for UTF-8 file names (e.g. |
@tiangolo That wasn't clear from the release notes as they only described internals of Python's stdlib instead of the effects it has on the usage of this library. But thanks. Upgrading now! |
♻️ Refactor header option parser to use the standard library instead of a custom RegEx
This uses the internal standard library module to parse MIME type (Content-Type) parameters instead of using a manual RegEx.
With inspiration from Baize: https://github.com/abersheeran/baize/blob/174c21a044cdc69b637f70030c0aad2dc8be5de1/baize/utils.py#L39-L76 but instead of copy-pasting utils from the standard library, using the suggested approach in the PEP, using another utility.
Ref: https://peps.python.org/pep-0594/#cgi