[Patchew-devel] [PATCH 1/3] api: anchor all URLs

Paolo Bonzini posted 3 patches 75 weeks ago

[Patchew-devel] [PATCH 1/3] api: anchor all URLs

Posted by Paolo Bonzini 75 weeks ago
---
 api/urls.py | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/api/urls.py b/api/urls.py
index 8977acb..f71a5e4 100644
--- a/api/urls.py
+++ b/api/urls.py
@@ -22,7 +22,7 @@ def _build_urls(base=None, r=[]):
         if cls.name:
             # API views should handle the authentication explicitly, disable
             # csrf check to simplify client code
-            r.append(url(cls.name + "/", cls.as_view()))
+            r.append(url("^" + cls.name + "/", cls.as_view()))
         else:
             _build_urls(cls, r)
     return r
@@ -49,9 +49,9 @@ results_router.register('results', rest.SeriesResultsViewSet, base_name='results
 schema_view = get_schema_view(title='API schema')
 
 urlpatterns = _build_urls() + [
-    url(r"v1/", include(router.urls)),
-    url(r"v1/", include(projects_router.urls)),
-    url(r"v1/", include(results_router.urls)),
+    url(r"^v1/", include(router.urls)),
+    url(r"^v1/", include(projects_router.urls)),
+    url(r"^v1/", include(results_router.urls)),
     url(r'^v1/schema/$', schema_view),
     # Use the base class's handler by default
     url(r".*", views.APIView.as_view())
-- 
2.21.0


_______________________________________________
Patchew-devel mailing list
Patchew-devel@redhat.com
https://www.redhat.com/mailman/listinfo/patchew-devel