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

Catch uWSGI TypeError for invalid headers #603

Merged

Conversation

kaij
Copy link
Contributor

@kaij kaij commented Dec 29, 2020

Catch TypeError thrown by uWSGI in addition to UnicodeError

Motivation and Context

The fix for invalid headers merged with #536 seems not to be working with Docker/uWSGI/Python3. Looking at https://github.com/unbit/uwsgi/blob/master/plugins/python/wsgi_headers.c#L140, uWSGI is throwing a TypeError, not a UnicodeError. However, UnicodeError is correct when not using uWSGI (e.g. run with cli.py).

Catching the TypeError solves the replay problem also when running pywb with Docker/uWSGI/Python3.

Types of changes

  • Replay fix (fixes a replay specific issue)
  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Checklist:

  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have added or updated tests to cover my changes.
  • All new and existing tests passed.

@codecov
Copy link

codecov bot commented Dec 29, 2020

Codecov Report

Merging #603 (6eab105) into master (7b51101) will decrease coverage by 0.51%.
The diff coverage is 0.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #603      +/-   ##
==========================================
- 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     
Impacted Files Coverage Δ
pywb/apps/wbrequestresponse.py 83.33% <0.00%> (ø)
pywb/utils/geventserver.py 68.42% <0.00%> (-7.90%) ⬇️
pywb/rewrite/rewriteinputreq.py 71.87% <0.00%> (-6.25%) ⬇️
pywb/apps/frontendapp.py 82.85% <0.00%> (-5.15%) ⬇️
pywb/apps/rewriterapp.py 83.22% <0.00%> (-4.68%) ⬇️
pywb/utils/loaders.py 91.24% <0.00%> (-1.46%) ⬇️
pywb/recorder/multifilewarcwriter.py 76.83% <0.00%> (-1.13%) ⬇️
pywb/rewrite/url_rewriter.py 87.00% <0.00%> (-1.00%) ⬇️
pywb/warcserver/index/aggregator.py 91.47% <0.00%> (+1.55%) ⬆️
pywb/apps/static_handler.py 88.09% <0.00%> (+2.38%) ⬆️
... and 1 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 7b51101...6eab105. Read the comment docs.

@ikreymer ikreymer merged commit a0aaa75 into webrecorder:master Jan 26, 2021
@ikreymer
Copy link
Member

That makes sense, thanks for the fix!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants