snok / asgi-correlation-id

Request ID propagation for ASGI apps
MIT License
370 stars 29 forks source link

fix: Simplify header logic #30

Closed sondrelg closed 2 years ago

sondrelg commented 2 years ago

Resolves #29

25 seems to have introduced a bug. Looking over the starlette Headers docs, it seems we're making life harder for ourselves than we need to. Using MutableHeaders rids us of all explicit type casting.

codecov[bot] commented 2 years ago

Codecov Report

Merging #30 (e7f6370) into main (a53e851) will not change coverage. The diff coverage is 100.00%.

@@            Coverage Diff            @@
##              main       #30   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files           11        11           
  Lines          288       284    -4     
=========================================
- Hits           288       284    -4     
Impacted Files Coverage Δ
asgi_correlation_id/middleware.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 a53e851...e7f6370. Read the comment docs.