falconry / falcon

The no-magic web data plane API and microservices framework for Python developers, with a focus on reliability, correctness, and performance at scale.
https://falcon.readthedocs.io/en/stable/
Apache License 2.0
9.51k stars 937 forks source link

feat(parse_header): provide our own implementation of `parse_header()` #2217

Closed vytas7 closed 6 months ago

vytas7 commented 6 months ago

I have another branch which also introduces Cython's "pure Python mode" in order to speed up parse_header(), but we can circle back on that optimization in Falcon 4.1.

I'm also planning to reimplement the parts of mimeparse that we actually use, and unvendor it completely.

Fixes #2066

codecov[bot] commented 6 months ago

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Project coverage is 100.00%. Comparing base (a78cfb3) to head (e209b20).

Additional details and impacted files ```diff @@ Coverage Diff @@ ## master #2217 +/- ## ========================================= Coverage 100.00% 100.00% ========================================= Files 62 63 +1 Lines 6888 6930 +42 Branches 1099 1109 +10 ========================================= + Hits 6888 6930 +42 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

vytas7 commented 6 months ago

have just glanced at the mediatypes module since it's copied from the stdlib.

Did you make changes to it?

@CaselIT yes, I wrote a much simpler implementation for the common case, and fall back to the old stdlib impl for more complex cases.

CaselIT commented 6 months ago

Ok, I'll take a better look later