Opened 4 years ago

Closed 4 years ago

#32871 closed Bug (invalid)

Issue on documentation: path /articles/2003 does match the urlpattern 'articles/2003/'

Reported by: Nilo César Teixeira Owned by: nobody
Component: Core (URLs) Version: 3.2
Severity: Normal Keywords: urlpatterns, path, ending URL slash, redirection
Cc: Triage Stage: Unreviewed
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description

https://docs.djangoproject.com/en/3.2/topics/http/urls/#example says:

/articles/2003 would not match any of these patterns, because each pattern requires that the URL end with a slash.

But in django 3.2.4, this seems wrong:

[21/Jun/2021 15:12:09] "GET /articles/2003 HTTP/1.1" 301 0
[21/Jun/2021 15:12:09] "GET /articles/2003/ HTTP/1.1" 200 765

There's a redirect to the correct URL.

So, is documentation wrong ?

Thanks in advance.

Change History (1)

comment:1 by Carlton Gibson, 4 years ago

Resolution: invalid
Status: newclosed

The URL doesn't match, but APPEND_SLASH is enabled by default, so the redirect to the URL that does match is issued.

Note: See TracTickets for help on using tickets.
Back to Top