Skip to content
This repository has been archived by the owner on Mar 28, 2019. It is now read-only.

Commit

Permalink
404 error pages handle CORS headers. (fixes #5)
Browse files Browse the repository at this point in the history
  • Loading branch information
Rémy HUBSCHER committed Aug 31, 2015
1 parent 9591f3a commit ca01bd4
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions syncto/tests/test_functional.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,15 @@ def test_client_state_header_is_required_for_records(self):
resp, 401, ERRORS.MISSING_AUTH_TOKEN, "Unauthorized",
"Provide the tokenserver %s header." % CLIENT_STATE_HEADER)

def test_404_endpoint_returns_cors_headers(self):
headers = self.headers.copy()
headers['Origin'] = 'notmyidea.org'
response = self.app.get('/unknown',
headers=headers,
status=404)
self.assertEqual(response.headers['Access-Control-Allow-Origin'],
'notmyidea.org')


class CollectionTest(FormattedErrorMixin, BaseWebTest, unittest.TestCase):

Expand Down

0 comments on commit ca01bd4

Please sign in to comment.