The nginx documentation points to a reason:
https://nginx.org/en/docs/http/ngx_http_core_module.html#merge_slashes

 Note that compression is essential for the correct matching of prefix
> string and regular expression locations. Without it, the
> “//scripts/one.php” request would not match
>
>     location /scripts/ { ...
>

I think this much more of a concern with classic web servers that serve up
files from your filesystem directly from the URL..

It also points to a reason why it would be backwards incompatible of Django
to start doing this:

 Turning the compression off can become necessary if a URI contains
> base64-encoded names, since base64 uses the “/” character internally.
> However, for security considerations, it is better to avoid turning the
> compression off
>

On Wed, 4 Mar 2020 at 19:31, Bjoern Boschman <[email protected]>
wrote:

> Hi Adam,
>
> APPEND_SLASH only adds a slash at the end of the path
> I'm more concerned about having multiple slashes in the middle of the path
> I get your point about canonical URLs - I'm just confused why other major
> HTTP servers are handling this different
>
> On Wednesday, 4 March 2020 14:27:19 UTC-5, Adam Johnson wrote:
>>
>> I'd be against this
>>
>> Merging multiple slashes is a way of duplicating canonical URL's for
>> things, something Django actively tries to avoid with APPEND_SLASHES.
>>
>> If you want this functionality you should be able to create it yourself
>> with a custom URL converter or URLPattern subclass.
>>
>> On Wed, 4 Mar 2020 at 14:41, Bjoern Boschman <[email protected]>
>> wrote:
>>
>>> Hi,
>>>
>>> I'd like to start a discussion about how django handles multiple slashes.
>>> see: https://code.djangoproject.com/ticket/31319#comment:1
>>>
>>> So far I can confirm that nginx, apache and unix folders handle multiple
>>> slashes the same way (-> they get merged)
>>> What's your (dev) opinion on this?
>>>
>>> Cheers
>>> B
>>>
>>> TV Squared Limited is a company registered in Scotland.  Registered
>>> number: SC421072.  Registered office: CodeBase, Argyle House, 3 Lady Lawson
>>> Street, Edinburgh, EH3 9DR.
>>>
>>> TV Squared Inc (File No. 5600204) is an Incorporated company registered
>>> in Delaware. Principal office: 1412 Broadway, 22 Fl, New York, New York,
>>> 10018
>>>
>>> TV Squared GmbH is a company registered in Munich. Registered number:
>>> HRB 236077. Registered office: Oskar-von-Miller-Ring 20, c/o wework, 80333
>>> Munchen
>>>
>>> This message is private and confidential.  If you have received this
>>> message in error, please notify us and remove it from your system.
>>>
>>> --
>>> 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 [email protected].
>>> To view this discussion on the web visit
>>> https://groups.google.com/d/msgid/django-developers/0afe6cd9-952e-46a7-b756-10bb04eb70e9%40googlegroups.com
>>> <https://groups.google.com/d/msgid/django-developers/0afe6cd9-952e-46a7-b756-10bb04eb70e9%40googlegroups.com?utm_medium=email&utm_source=footer>
>>> .
>>>
>>
>>
>> --
>> Adam
>>
>
> TV Squared Limited is a company registered in Scotland.  Registered
> number: SC421072.  Registered office: CodeBase, Argyle House, 3 Lady Lawson
> Street, Edinburgh, EH3 9DR.
>
> TV Squared Inc (File No. 5600204) is an Incorporated company registered in
> Delaware. Principal office: 1412 Broadway, 22 Fl, New York, New York, 10018
>
> TV Squared GmbH is a company registered in Munich. Registered number: HRB
> 236077. Registered office: Oskar-von-Miller-Ring 20, c/o wework, 80333
> Munchen
>
> This message is private and confidential.  If you have received this
> message in error, please notify us and remove it from your system.
>
> --
> 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 [email protected].
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-developers/fce90055-ce46-4704-b81e-afc64bcde358%40googlegroups.com
> <https://groups.google.com/d/msgid/django-developers/fce90055-ce46-4704-b81e-afc64bcde358%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
>


-- 
Adam

-- 
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 [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-developers/CAMyDDM1sZ4TMxGFdaxYTUcPas%3DiifZk_%3DUCNeX_GNfd4LH5MMw%40mail.gmail.com.

Reply via email to