Permalink
Browse files

bug 922621, add CORS header for our data exports, r=peterbe

  • Loading branch information...
1 parent bbcf012 commit 5f78a11915e9d7d65c1222e48c70339aedd93f39 @Pike Pike committed Oct 1, 2013
Showing with 3 additions and 0 deletions.
  1. +2 −0 apps/shipping/tests/test_views.py
  2. +1 −0 apps/shipping/views/status.py
@@ -329,6 +329,8 @@ def test_status_json_basic(self):
response = self.client.get(url)
struct = json.loads(response.content)
ok_(struct['items'])
+ ok_('Access-Control-Allow-Origin' in response)
+ eq_(response['Access-Control-Allow-Origin'], '*')
def test_status_json_by_treeless_appversion(self):
url = reverse('shipping.views.status.status_json')
@@ -78,6 +78,7 @@ def get(self, request, *args, **kwargs):
r = HttpResponse(content, content_type='text/plain; charset=utf-8')
if self.filename:
r['Content-Disposition'] = 'inline; filename="%s"' % self.filename
+ r['Access-Control-Allow-Origin'] = '*'
return r

0 comments on commit 5f78a11

Please sign in to comment.