-
-
Notifications
You must be signed in to change notification settings - Fork 217
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
Handle Content-Type multipart/form-data without boundary #599
Handle Content-Type multipart/form-data without boundary #599
Conversation
Out of curiosity, what version of python are you running with? |
Hrrrm...I have gotten the error on Ubuntu 18.04.5 running in a Python 3.7.6 env and a 3.6.9 env when trying to index this warc and another (autoindex or using I have also tried this on another machine running Ubuntu 20.04 in Python 3.8.5 and see the same issue:
|
Ah, thanks for the steps. Heh, my mistake, i was testing it with just cdx-indexer which of course did not have the write settings by default! |
Could you add a quick test record with an invalid boundary? |
@ikreymer I have added a few tests: one for a regular well-formed multipart/form-data type that passes in master and this branch and a couple tests where the boundary part is missing which fail in master and pass on this branch. Let me know if you want to see any changes. Thanks! |
Codecov Report
@@ Coverage Diff @@
## master #599 +/- ##
==========================================
- Coverage 87.69% 87.18% -0.52%
==========================================
Files 64 64
Lines 8096 8099 +3
Branches 1445 1445
==========================================
- Hits 7100 7061 -39
- Misses 640 669 +29
- Partials 356 369 +13
Continue to review full report at Codecov.
|
Thanks! |
Description
Catches
ValueError
on a multipart/form-data mime when "boundary" is missing, and handles it in the same way as an earlier condition for 'application/x-www-form-urlencoded' erroring onUnicodeDecodeError
. When I try to run the tests withpython setup.py test
, test_proxy.py tests fail, but this seems unrelated and is the same when I run them on themaster
branch.Motivation and Context
Fix for #598 to handle a
ValueError
on a multipart/form-data mime when "boundary" is missing.Screenshots (if appropriate):
Types of changes
Checklist: