From 48ebbfb3223b6fc28eb00ce0c63cf1e58406b4cd Mon Sep 17 00:00:00 2001 From: Tom Hacohen Date: Fri, 15 May 2020 12:51:05 +0300 Subject: [PATCH] Disable host verification for debug mode. Was causing issues with mitm proxy and etc which was a pain. --- django_etesync/views.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/django_etesync/views.py b/django_etesync/views.py index 1a7c5bc..894f06d 100644 --- a/django_etesync/views.py +++ b/django_etesync/views.py @@ -403,7 +403,7 @@ class AuthenticationViewSet(viewsets.ViewSet): elif challenge_data['userId'] != user.id: content = {'code': 'wrong_user', 'detail': 'This challenge is for the wrong user'} return Response(content, status=status.HTTP_400_BAD_REQUEST) - elif host != request.get_host(): + elif not settings.DEBUG and host != request.get_host(): detail = 'Found wrong host name. Got: "{}" expected: "{}"'.format(host, request.get_host()) content = {'code': 'wrong_host', 'detail': detail} return Response(content, status=status.HTTP_400_BAD_REQUEST)