1
0
mirror of https://github.com/django/django.git synced 2025-10-24 06:06:09 +00:00

Fixed #32124 -- Added per-view opt-out for APPEND_SLASH behavior.

This commit is contained in:
Carlton Gibson
2020-10-20 09:14:48 +02:00
committed by Carlton Gibson
parent 3418092238
commit ad11f5b8c9
9 changed files with 89 additions and 9 deletions

View File

@@ -1,5 +1,19 @@
from django.http import HttpResponse
from django.utils.decorators import method_decorator
from django.views.decorators.common import no_append_slash
from django.views.generic import View
def empty_view(request, *args, **kwargs):
return HttpResponse()
@no_append_slash
def sensitive_fbv(request, *args, **kwargs):
return HttpResponse()
@method_decorator(no_append_slash, name='dispatch')
class SensitiveCBV(View):
def get(self, *args, **kwargs):
return HttpResponse()