URL patterns should be anchored. SEC-367

Some notes:

* The completion API was pulled out into a new repo, but left behind a
  url() entry.  That entry used a different namespace than the
  pulled-out repo, so I had to fix the one place we used the namespace.

* Two urls couldn't be anchored because they broke tests:

    url(r'users/(?P<user_id>\w+)/followed$', views.followed_threads, name='followed_threads'),
    url(r'users/(?P<user_id>\w+)$', views.user_profile, name='user_profile'),
This commit is contained in:
Ned Batchelder
2019-04-22 13:41:31 -04:00
parent 5d77bc7bcc
commit 2171ddb9df
10 changed files with 50 additions and 53 deletions

View File

@@ -17,7 +17,7 @@ class BookmarksConfig(AppConfig):
PluginURLs.CONFIG: {
ProjectType.LMS: {
PluginURLs.NAMESPACE: u'',
PluginURLs.REGEX: u'api/bookmarks/',
PluginURLs.REGEX: u'^api/bookmarks/',
PluginURLs.RELATIVE_PATH: u'urls',
}
},

View File

@@ -3,7 +3,7 @@ from django.apps import AppConfig
from openedx.core.djangoapps.plugins.constants import ProjectType, PluginURLs
plugin_urls_config = {PluginURLs.NAMESPACE: u'theming', PluginURLs.REGEX: u'theming/'}
plugin_urls_config = {PluginURLs.NAMESPACE: u'theming', PluginURLs.REGEX: r'^theming/'}
class ThemingConfig(AppConfig):