Skip to content
Snippets Groups Projects
Verified Commit 1937b6a1 authored by Tom Teichler's avatar Tom Teichler :beers:
Browse files

Fix checksum check

parent d7e09d80
No related branches found
No related tags found
No related merge requests found
Pipeline #4033 failed
...@@ -3,6 +3,6 @@ from django.urls import path ...@@ -3,6 +3,6 @@ from django.urls import path
from .views import APIView from .views import APIView
urlpatterns = [ urlpatterns = [
path("api/<str:method>", APIView.as_view()), path("api/<str:method>/", APIView.as_view()),
path("api", APIView.as_view()), path("api/", APIView.as_view()),
] ]
...@@ -18,7 +18,7 @@ class APIView(View): ...@@ -18,7 +18,7 @@ class APIView(View):
# Set to False to mimic the reference implementation more closely # Set to False to mimic the reference implementation more closely
_fix_status = True _fix_status = True
def dispatch(self, request: HttpRequest, method: str = "ping") -> HttpResponse: def dispatch(self, request: HttpRequest, method: str = "") -> HttpResponse:
# Find API tokens to allow for this request # Find API tokens to allow for this request
site = get_current_site(request) site = get_current_site(request)
api_tokens = APIToken.objects.filter(server_group__site=site) api_tokens = APIToken.objects.filter(server_group__site=site)
...@@ -47,7 +47,7 @@ class APIView(View): ...@@ -47,7 +47,7 @@ class APIView(View):
raise TypeError("API token has unexpected scope") raise TypeError("API token has unexpected scope")
# Proprietary extension for test purposes # Proprietary extension for test purposes
if method == "ping": if method in ("ping", ""):
return self._success( return self._success(
"xInfraBluePong", "The API is working correctly and your request was valid.", {"version": "2.0"} "xInfraBluePong", "The API is working correctly and your request was valid.", {"version": "2.0"}
) )
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment