#32698: Deprecate HttpRequest.get_raw_uri
------------------------------------------------+------------------------
               Reporter:  Adam Johnson          |          Owner:  nobody
                   Type:  Cleanup/optimization  |         Status:  new
              Component:  HTTP handling         |        Version:  dev
               Severity:  Normal                |       Keywords:
           Triage Stage:  Unreviewed            |      Has patch:  0
    Needs documentation:  0                     |    Needs tests:  0
Patch needs improvement:  0                     |  Easy pickings:  0
                  UI/UX:  0                     |
------------------------------------------------+------------------------
 `get_raw_uri()` is undocumented, insecure alternative to
 `build_absolute_uri(None)`. Django used it internally until
 ea542a9c7239b5b665797b7c809f1aceb0b412cf / #28007 (4 years ago). Since
 then it only exists in tests.

 The only ticket mentioning `get_raw_uri()` is #27506, recommending its use
 in the opbeat python integration.

 GitHub code search reveals
 [https://github.com/search?l=Python&q=%22request.get_raw_uri%22&type=Code
 1000 hits for `get_raw_uri`], but
 
[https://github.com/search?l=Python&q=%22request.build_absolute_uri%22&type=Code
 40,000 hits for `build_absolute_uri`].

 Users seem to be stumbling upon `get_raw_uri()`, e.g. from IDE
 autocompletion, when they want `build_absolute_uri()`.

 I think we should deprecate it. Niche use cases, such as APM packages like
 opbeat, can read the internal attributes of `HttpRequest` instead.

-- 
Ticket URL: <https://code.djangoproject.com/ticket/32698>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/053.baee31dca5d1cbc46c6c9d362d2a58a6%40djangoproject.com.

Reply via email to