HttpRequest.META is not deprecated
See original GitHub issuePython Version
3.8.10
Django Version
3.2
Package Version
1.0.0
Description
According to the documentation of HttpRequest.META, HttpRequest.META is not deprecated in any version of django, so the rule in django-upgrade which converts these calls to request.headers
and removes the HTTP prefix looks like it is too strict.
Issue Analytics
- State:
- Created 2 years ago
- Comments:5 (2 by maintainers)
Top Results From Across the Web
[Django] #20147: Replace and deprecate request.META for HTTP ...
This leaves a few things in META that are not derived from an HTTP header, and do not have a way of accessing...
Read more >XMLHttpRequest is deprecated. What to use instead?
Trying to use a pure JS approach to check if I have a valid JS image url. I am getting a warning that...
Read more >Is noconnect really deprecated? https request over https proxy ...
Because when I directed the proxy url to a server I control with noconnect added, the proxy reports making a connect anyways. So...
Read more >Content-Security-Policy - HTTP - MDN Web Docs - Mozilla
Chrome Edge
Content‑Security‑Policy Full support. Chrome25. more. Toggle history Full sup...
base‑uri Full support. Chrome40. Toggle history Full sup...
block‑all‑mixed‑content. Deprecated Full support. ChromeYes. Toggle history...
Read more >HttpRequest Class | Apex Reference Guide
Use the HttpRequest class to programmatically create HTTP requests like GET, ... This method is deprecated. ... If false , no compression format...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I’ve improved the description in #73 to not only mention deprecations.
For old features we’ve been historically reticent to deprecate them or recommend the new one, because of the churn. My hope is this tool helps reduce the cost of that churn so we can make more required changes.
I don’t think there’s a reasonable claim that
request.META["HTTP_FOO"]
is “better” in any way torequest.headers["Foo"]
. The old way is just terrible and unfriendly.I have sympathy for this approach but I don’t really want to complicate django-upgrade. pyupgrade takes a similar “all or nothing” approach, albeit with three special case flags.
I would add a flag if there was a potential bug or compelling reason to keep
request.META
, but I don’t see one. If you want to incrementally add the changes, you can always usegit add --patch
for your commit or filter hunks with a regex.OK thanks 😃