maxcountryman / flask-seasurf

SeaSurf is a Flask extension for preventing cross-site request forgery (CSRF).
http://readthedocs.org/docs/flask-seasurf/
Other
190 stars 49 forks source link

Prevent unhandled exception from invalid referer hosts #96

Closed alanhamlett closed 4 years ago

alanhamlett commented 4 years ago

Bad clients can send Referer header with malformed urls, for ex: port that isn't a number.

This change catches the exception from urllib.parse and results in a 403 error instead of 500 error.

maxcountryman commented 4 years ago

Good catch!