From 68d21874b5422439166e1318d26b445234703d5b Mon Sep 17 00:00:00 2001 From: Martin Mahner Date: Thu, 5 Dec 2019 15:30:20 +0100 Subject: [PATCH] Allow slim view to be iframed. Refs #126 --- dpaste/urls/dpaste.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/dpaste/urls/dpaste.py b/dpaste/urls/dpaste.py index b946a5f..e116ca3 100644 --- a/dpaste/urls/dpaste.py +++ b/dpaste/urls/dpaste.py @@ -1,6 +1,7 @@ from django.apps import apps from django.conf import settings from django.conf.urls import url +from django.views.decorators.clickjacking import xframe_options_exempt from django.views.generic import TemplateView from .. import views @@ -31,7 +32,11 @@ urlpatterns = [ ), url( r'^(?P[a-zA-Z0-9]{%d,})/slim/?$' % L, - views.SnippetDetailView.as_view(template_name='dpaste/details_slim.html'), + xframe_options_exempt( + views.SnippetDetailView.as_view( + template_name='dpaste/details_slim.html' + ) + ), name='snippet_details_slim', ), ]