Permalink
Browse files

Merge pull request #855 from groovecoder/attachment-iframe-840052

fix bug 840052 - let DOMAIN iframe attachments
  • Loading branch information...
2 parents 94a7426 + d79c7ee commit fc70f2e912dbb2798644cbe7f90cdc88dced230b @darkwing darkwing committed Feb 12, 2013
Showing with 2 additions and 0 deletions.
  1. +1 −0 apps/wiki/tests/test_views.py
  2. +1 −0 apps/wiki/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
@@ -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 fc70f2e

Please sign in to comment.