Skip to content
Browse files

fix bug 840052 - let DOMAIN iframe attachments

  • Loading branch information...
1 parent 53f679b commit d79c7ee0536703c11ed23434ce8e435791cec9d4 @groovecoder groovecoder committed Feb 11, 2013
Showing with 2 additions and 0 deletions.
  1. +1 −0 apps/wiki/tests/test_views.py
  2. +1 −0 apps/wiki/views.py
View
1 apps/wiki/tests/test_views.py
@@ -3239,6 +3239,7 @@ def test_attachment_raw_requires_attachment_host(self):
url = attachment.get_file_url()
resp = self.client.get(url, HTTP_HOST=settings.ATTACHMENT_HOST)
+ eq_('ALLOW-FROM: %s' % settings.DOMAIN, resp['x-frame-options'])
eq_(200, resp.status_code)
def test_attachment_detail(self):
View
1 apps/wiki/views.py
@@ -2093,6 +2093,7 @@ def raw_file(request, attachment_id, filename):
resp = HttpResponse(rev.file.read(), mimetype=rev.mime_type)
resp["Last-Modified"] = rev.created
resp["Content-Length"] = rev.file.size
+ resp['x-frame-options'] = 'ALLOW-FROM: %s' % settings.DOMAIN
return resp
else:
return HttpResponsePermanentRedirect(attachment.get_file_url())

0 comments on commit d79c7ee

Please sign in to comment.
Something went wrong with that request. Please try again.