jazzband / django-silk

Silky smooth profiling for Django
MIT License
4.35k stars 333 forks source link

Switch from request META to request headers #641

Closed albertyw closed 1 year ago

albertyw commented 1 year ago

As recommended by https://github.com/adamchainz/django-upgrade#httprequestheaders, switch from request.META to request.headers. This slightly simplifies several test cases by not having to convert between META and headers (see https://docs.djangoproject.com/en/dev/ref/request-response/#httprequest-objects for more information). However, headers are case insensitive which introduces some case-changes.

All of the changes in this PR are limited to tests, except for a very minor change when generating curls.

This is a followup to https://github.com/jazzband/django-silk/pull/640#issuecomment-1375269162

codecov[bot] commented 1 year ago

Codecov Report

Merging #641 (3c7a9c8) into master (4784e2a) will decrease coverage by 0.03%. The diff coverage is 100.00%.

:exclamation: Current head 3c7a9c8 differs from pull request most recent head 3bdd577. Consider uploading reports for the commit 3bdd577 to get more accurate results

@@            Coverage Diff             @@
##           master     #641      +/-   ##
==========================================
- Coverage   86.40%   86.37%   -0.04%     
==========================================
  Files          52       52              
  Lines        2089     2084       -5     
==========================================
- Hits         1805     1800       -5     
  Misses        284      284              
Impacted Files Coverage Δ
silk/code_generation/curl.py 47.22% <ø> (ø)
silk/model_factory.py 84.07% <100.00%> (-0.35%) :arrow_down:

:mega: We’re building smart automated test selection to slash your CI/CD build times. Learn more