1
0
mirror of https://github.com/etesync/server synced 2024-12-27 09:48:24 +00:00

Disable host verification for debug mode.

Was causing issues with mitm proxy and etc which was a pain.
This commit is contained in:
Tom Hacohen 2020-05-15 12:51:05 +03:00
parent f438d0e947
commit 48ebbfb322

View File

@ -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)