-
Notifications
You must be signed in to change notification settings - Fork 299
properly anchor ends of url patterns #697
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Codecov Report
@@ Coverage Diff @@ ## master #697 +/- ## ======================================= Coverage 95.97% 95.97% ======================================= Files 54 54 Lines 2735 2735 ======================================= Hits 2625 2625 Misses 110 110
Continue to review full report at Codecov.
|
Codecov Report
@@ Coverage Diff @@ ## master #697 +/- ## ======================================= Coverage 95.97% 95.97% ======================================= Files 54 54 Lines 2735 2735 ======================================= Hits 2625 2625 Misses 110 110
Continue to review full report at Codecov.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
...Removed changelog entry though as I think this change is not relevant to current DJA users but only for new users which will start with the example app anyway.
@sliverc Not a big deal, but I expect existing users trying to use the new generateschema functionality will be burned if their code follows the examples and lacks $
or /
due to the django simplify_regex bug fix: django/django#11728 which likely won't appear until Django 3.0.
@n2ygk this is properly better explained in the documentation of generateschema
as someone not having based its urls.py on the example app might have the exact same issue as well.
Description of the Change
The example usage of
url()
inexample/urls.py
andexample/urls_test.py
was missingthe
$
anchor at the end of most patterns. Best practice is to fully specify an anchored URL to avoid inadvertently matching a substring.For example:
url(r'foo/bar')
will match/foo/bar
but also/foo/barf
.Checklist
$
anchors)CHANGELOG.md
updated (only for user relevant changes)AUTHORS