Skip to content
Snippets Groups Projects
Commit 6738f860 authored by m431m's avatar m431m :speech_balloon:
Browse files

Force accept all */* [REDMINE_ISSUE-16761]

parent 85970f9f
No related branches found
No related tags found
No related merge requests found
...@@ -20,6 +20,7 @@ from django.conf import settings ...@@ -20,6 +20,7 @@ from django.conf import settings
from drfreverseproxy.views import ProxyView from drfreverseproxy.views import ProxyView
from rest_framework.authentication import BasicAuthentication from rest_framework.authentication import BasicAuthentication
from rest_framework.authentication import SessionAuthentication from rest_framework.authentication import SessionAuthentication
from rest_framework.negotiation import DefaultContentNegotiation
from rest_framework import permissions from rest_framework import permissions
...@@ -35,6 +36,11 @@ class SessionCsrfExemptAuthentication(SessionAuthentication): ...@@ -35,6 +36,11 @@ class SessionCsrfExemptAuthentication(SessionAuthentication):
pass pass
class MapstoreProxyContentNegotiation(DefaultContentNegotiation):
def get_accept_list(self, _):
return ['*/*'] # Force accept all
class MapstoreProxyView(ProxyView): class MapstoreProxyView(ProxyView):
upstream = ONEGEOSUITE_MAPSTORE_UPSTREAM upstream = ONEGEOSUITE_MAPSTORE_UPSTREAM
...@@ -47,6 +53,8 @@ class MapstoreProxyView(ProxyView): ...@@ -47,6 +53,8 @@ class MapstoreProxyView(ProxyView):
permissions.AllowAny, permissions.AllowAny,
] ]
content_negotiation_class = MapstoreProxyContentNegotiation
def get_request_headers(self): def get_request_headers(self):
""" """
Place le nom utilisateur dans un Header HTTP pour que Mapstore puisse Place le nom utilisateur dans un Header HTTP pour que Mapstore puisse
......
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