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(Request): add Request.headers_lower to provide a normalized interface between WSGI and ASGI #2063

Closed kgriffs closed 2 years ago

kgriffs commented 2 years ago

Summary of Changes

This patch adds a headers_lower property to provide a unified way to get all headers lowercased for middleware, etc. that needs to be compatible with both WSGI and ASGI. This was done in lieu of introducing a breaking change to the WSGI headers property.

Related Issues

N/A

Pull Request Checklist

This is just a reminder about the most common mistakes. Please make sure that you tick all appropriate boxes. But please read our contribution guide at least once; it will save you a few review cycles!

If an item doesn't apply to your pull request, check it anyway to make it apparent that there's nothing to do.

If you have any questions to any of the points above, just submit and ask! This checklist is here to help you, not to deter you from contributing!

PR template inspired by the attrs project.

codecov[bot] commented 2 years ago

Codecov Report

Merging #2063 (f6f6c4a) into master (47e3e16) will not change coverage. The diff coverage is 100.00%.

@@            Coverage Diff            @@
##            master     #2063   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files           63        63           
  Lines         6715      6722    +7     
  Branches      1242      1244    +2     
=========================================
+ Hits          6715      6722    +7     
Impacted Files Coverage Δ
falcon/asgi/request.py 100.00% <100.00%> (ø)
falcon/request.py 100.00% <100.00%> (ø)

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 47e3e16...f6f6c4a. Read the comment docs.

CaselIT commented 2 years ago

@kgriffs you forgot to commit the news fragment