Closed aneshujevic closed 3 months ago
Thank you, I may not have time until after PyCon to review this, but I will get to it.
After reviewing this PR and my previous refactoring work on this function, I decided to go with a different implementation in #2939. Thanks for working on this!
When parsing certain
Content-Type
headers http parser would take too much time because of exhaustive regex matching.Instead of using regex matching for parsing options we're using FSM (similar to one used in Django, actually the main idea of it was taken from there), so the performance is much better and the exhaustive regex matching is avoided, this way we won't have performance issues when someone tries something like ReDoS on options headers.
fixes #2904
Please take a look at the PR so we can fix the issue, thanks!
Also wanted to thank you for one of the best and most comprehensive test suites I've seen. It eased the development a lot, so thank you once more!