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

Commit

Permalink
typo fix
Browse files Browse the repository at this point in the history
  • Loading branch information
Allen Short committed Mar 13, 2013
1 parent d20ee4a commit 0ba1faf
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion mkt/api/middleware.py
Expand Up @@ -53,7 +53,7 @@ def process_response(self, request, response):
# responses.
if getattr(request, 'CORS', None):
# If this is a request from our hosted frontend, allow cookies.
if request.META.get('ORIGIN') == settings.FIREPLACE_URL:
if request.META.get('HTTP_ORIGIN') == settings.FIREPLACE_URL:
response['Access-Control-Allow-Origin'] = settings.FIREPLACE_URL
response['Access-Control-Allow-Credentials'] = 'true'
else:
Expand Down
4 changes: 2 additions & 2 deletions mkt/api/tests/test_middleware.py
Expand Up @@ -11,7 +11,7 @@
CORSMiddleware)
from mkt.site.middleware import RedirectPrefixedURIMiddleware

fireplace_url = "http://firepla.ce:1234"
fireplace_url = 'http://firepla.ce:1234'


class TestCORS(amo.tests.TestCase):
Expand Down Expand Up @@ -39,7 +39,7 @@ def test_post(self):
@mock.patch.object(settings, 'FIREPLACE_URL', fireplace_url)
def test_from_fireplace(self):
self.req.CORS = ['get']
self.req.META['ORIGIN'] = fireplace_url
self.req.META['HTTP_ORIGIN'] = fireplace_url
res = self.mware.process_response(self.req, HttpResponse())
eq_(res['Access-Control-Allow-Origin'], fireplace_url)
eq_(res['Access-Control-Allow-Methods'], 'GET, OPTIONS')
Expand Down

0 comments on commit 0ba1faf

Please sign in to comment.