X-Git-Url: https://git.mdrn.pl/wolnelektury.git/blobdiff_plain/1434b3dfc0495e885921acb726df6cc06e00c5ed..6b87b2b7014a0441f5f696a35127f12a89e48d2e:/src/api/utils.py?ds=sidebyside diff --git a/src/api/utils.py b/src/api/utils.py index 6dc7e4505..045ce90e9 100644 --- a/src/api/utils.py +++ b/src/api/utils.py @@ -3,7 +3,9 @@ # Copyright © Fundacja Nowoczesna Polska. See NOTICE for more information. # from django.http import HttpResponse +from django.utils.decorators import method_decorator from django.utils.encoding import iri_to_uri +from django.views.decorators.vary import vary_on_headers def oauthlib_request(request): @@ -31,3 +33,6 @@ def oauthlib_response((headers, body, status)): v = iri_to_uri(v) response[k] = v return response + + +vary_on_auth = method_decorator(vary_on_headers('Authorization'), 'dispatch')