]> git.parisson.com Git - teleforma.git/commitdiff
Migrate middleware to django 3
authortest test <yoanl@pilotsystems.net>
Wed, 26 May 2021 16:00:55 +0000 (18:00 +0200)
committerYoan Le Clanche <yoanl@pilotsystems.net>
Wed, 12 Apr 2023 09:12:02 +0000 (11:12 +0200)
teleforma/middleware.py

index a5c8511f76b65d586b367042bea4c84bb01c335e..898bf3d9d9de751041f77fb3f6a201fc32e8babe 100644 (file)
@@ -12,7 +12,7 @@ except:
     XS_SHARING_ALLOWED_HEADERS = ['Origin', 'Content-Type', 'Accept']
 
 
-class XsSharing(object):
+class XsSharing:
     """
         This middleware allows cross-domain XHR using the html5 postMessage API.
 
@@ -24,6 +24,10 @@ class XsSharing(object):
     def __init__(self, get_response):
         self.get_response = get_response
 
+    def __call__(self, request):
+        response = self.get_response(request)
+        return response
+
     def process_request(self, request):
 
         if 'HTTP_ACCESS_CONTROL_REQUEST_METHOD' in request.META: