-
Notifications
You must be signed in to change notification settings - Fork 116
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 URL encoding issue in HttpDownloader to handle special characters #5809
Conversation
Please, write a changelog message named after the issue number, like so: CHANGES/5686.bugfix. |
527d9c8
to
f4704d8
Compare
Ah yea, sorry it was late yesterday xD |
For additional context: The issue we faced wasn't simply that the filename contained |
1ac61f8
to
0a433ce
Compare
Added some tests for this as well. |
0a433ce
to
e9f80d4
Compare
idk why the test is failing on github 😢 |
hi @hstct I was checking this error, and I think it might be related to the way aiohttp server is parsing the request (but it is just a guess, I could not make it work yet): pulpcore/pulpcore/pytest_plugin.py Lines 322 to 328 in e360a13
I will do more tests and let you know if I find something. |
I managed to make the test work by modifying the pulpcore/pytest_plugin.py file with:
but I don't know the impact of this change in the other tests, or if this could be even considered a viable "solution". |
hi @git-hyagi thanks for the help! As far as I can tell and this has been the whole problem with this issue in general is that it always is dependent on how the web server is serving the files, whether or not it will encode |
e9f80d4
to
35eaf4a
Compare
35eaf4a
to
bd062e7
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for the contribution!
LGTM
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice testing!
I am afraid we may have shot ourselves in the foot here. Our internal integration tests revealed that while this fixes what we set out to fix, it broke the far more important use case of "download URL's with special characters in them". I have just verified this using latest pulpcore main branch in oci-env. I tried syncing a fairly standard APT repo, which failed because Pulp tried to download I suggest we revert this PR for now, until we can figure out a better approach. Unfortunately I fear there may be no good way to make the down-loader robust for both use cases. |
closes #5686