martin-bts / askbot-devel

Askbot is a Django/Python Q&A forum. **Contributors README**: https://github.com/ASKBOT/askbot-devel#how-to-contribute. Commercial hosting of Askbot and support are available at https://askbot.com
Other
0 stars 2 forks source link

'^robots.txt$' uses include with a regex ending with a '$' #5

Open sebastian-philipp opened 5 years ago

sebastian-philipp commented 5 years ago
WARNINGS:
?: (urls.W001) Your URL pattern '^robots.txt$' uses include with a regex ending with a '$'. Remove the dollar from the regex to avoid problems including URLs.
martin-bts commented 5 years ago

The statement in question is

url(r'^robots.txt$', include('robots.urls'))

and in most cases where one uses include() the result is multiple additions to the url patterns. With the $ we imply that it must be exactly one.

One could go into security discussions because omitting the $ would mean there can be an arbitrary URI whereas we force exactly robots.txt.

IMO it's a minor issue and I wouldn't oppose seimply removing the $ in order to get rid of that warning.

sebastian-philipp commented 5 years ago

:+1: for r'^robots.txt'