From 37dd0eeb4f37b76599aae67c85f76e0521ed2173 Mon Sep 17 00:00:00 2001 From: sabzo Date: Thu, 29 Sep 2022 23:43:49 -0400 Subject: [PATCH] redirect on GET request, and return 405 on other http methods --- perma_web/api/views.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/perma_web/api/views.py b/perma_web/api/views.py index 4c4b17828..6e92b60fe 100644 --- a/perma_web/api/views.py +++ b/perma_web/api/views.py @@ -22,6 +22,7 @@ url_is_invalid_unicode from .serializers import FolderSerializer, CaptureJobSerializer, LinkSerializer, AuthenticatedLinkSerializer, \ LinkUserSerializer, OrganizationSerializer, LinkBatchSerializer, DetailedLinkBatchSerializer +from django.conf import settings ### BASE VIEW ### @@ -162,8 +163,7 @@ class DeveloperDocsView(APIView): def get(self, request, format=None): """ Redirect to Developer Docs. """ # for testing if this view gets called for a '/' request - print('ok') - return Response(status=status.HTTP_204_NO_CONTENT) + return HttpResponseRedirect(redirect_to=self.request.scheme + '://' + settings.HOST + '/docs/developer') ### FOLDER VIEWS ###