On Thursday, April 29, 2021 at 4:23:57 PM UTC+2 atd...@gmail.com wrote:

> In both cases however, the current check being done in the 
> process_response method for the CommonMiddleware(here 
> <https://github.com/django/django/blob/4ab3ef238edfa7c7b7c2c4420c7ae5b722bde121/django/middleware/common.py#L105-L108>)
>  
> seems irrelevant to me unless I am missing *something*. 
>

You are most likely not missing anything and we also noticed that when 
fixing the admin enumeration stuff. But we did not get around to fixing it 
yet. That said, I think doing this in process_response would be preferable 
over doing it in process_request so the extra checks when the URL is valid 
(the common case) are reduced. Resolving URLs can take a bit, especially 
when the urlconf is long and as such I'd like to get that check out of the 
"hot" code path. Only doing the redirect in the case of a failing resolve 
in the first place would probably make this more efficient.

Cheers,
Florian

-- 
You received this message because you are subscribed to the Google Groups 
"Django developers  (Contributions to Django itself)" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-developers+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-developers/baf9fa2e-c339-4fed-8d57-643ed2830385n%40googlegroups.com.
  • APP... Tidiane Dia
    • ... 'Adam Johnson' via Django developers (Contributions to Django itself)
      • ... Tidiane Dia
        • ... Tidiane Dia
    • ... Florian Apolloner
      • ... Tidiane Dia
        • ... Florian Apolloner
          • ... Tidiane Dia
            • ... 'Adam Johnson' via Django developers (Contributions to Django itself)
              • ... Florian Apolloner
          • ... chris.j...@gmail.com
            • ... Florian Apolloner
              • ... 'Adam Johnson' via Django developers (Contributions to Django itself)

Reply via email to