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

Do not quote Multipart fields in forms #206

Merged
merged 1 commit into from
May 27, 2024

Conversation

madduck
Copy link
Contributor

@madduck madduck commented May 26, 2024

The aiohttp.FormData default is to encode all parameter data on form fields, and this causes e.g. spaces to be converted to %20, which are then exposed in the Paperless-NGX UI.

I interpret the aiohttp issue to mean that the filename should not be percent-encoded, and the proposed solution is to set quote_fields=False in the constructor of aiohttp.FormData.

Which is what this PR does.

The `aiohttp.FormData` default is to encode all parameter data on form
fields, and this causes e.g. spaces to be converted to `%20`, which are
then [exposed in the Paperless-NGX
UI](paperless-ngx/paperless-ngx#6830).

I interpret the [`aiohttp`
issue](aio-libs/aiohttp#6826) to mean that the
filename should *not* be percent-encoded, and the [proposed
solution](aio-libs/aiohttp#6826 (comment))
is to set `quote_fields=False` in the constructor of `aiohttp.FormData`.

Which is what this PR does.

Signed-off-by: martin f. krafft <[email protected]>
@madduck
Copy link
Contributor Author

madduck commented May 26, 2024

I cannot add labels so I cannot massage this into passing the workflow. Sorry.

@tb1337 tb1337 added the bugfix Inconsistencies or issues which will cause a problem for users or implementers. label May 27, 2024
@tb1337 tb1337 merged commit 6d63a2f into tb1337:main May 27, 2024
11 of 12 checks passed
@tb1337
Copy link
Owner

tb1337 commented May 27, 2024

Thank you, I approved the PR :)

@madduck madduck deleted the aiohttp_formdata_no_field_quoting branch May 27, 2024 14:08
@github-actions github-actions bot locked and limited conversation to collaborators May 29, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bugfix Inconsistencies or issues which will cause a problem for users or implementers.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants