Skip to content

Commit

Permalink
redirect on GET request, and return 405 on other http methods
Browse files Browse the repository at this point in the history
  • Loading branch information
sabzo committed Sep 30, 2022
1 parent e5f4d07 commit 37dd0ee
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions perma_web/api/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -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 ###
Expand Down Expand Up @@ -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 ###

Expand Down

0 comments on commit 37dd0ee

Please sign in to comment.