Skip to content

Commit

Permalink
Neaten this up a bit
Browse files Browse the repository at this point in the history
  • Loading branch information
mattrobenolt committed Feb 4, 2014
1 parent 66bf149 commit 68867da
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/sentry/utils/http.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,17 +55,17 @@ def is_same_domain(url1, url2):


def get_origins(project=None):
from sentry.plugins.helpers import get_option

# TODO: we should cache this
if settings.SENTRY_ALLOW_ORIGIN == '*':
return frozenset(['*'])
elif settings.SENTRY_ALLOW_ORIGIN:

if settings.SENTRY_ALLOW_ORIGIN:
result = settings.SENTRY_ALLOW_ORIGIN.split(' ')
else:
result = []

if project:
# TODO: we should cache this
from sentry.plugins.helpers import get_option
optval = get_option('sentry:origins', project)
if optval:
result.extend(optval)
Expand Down Expand Up @@ -115,7 +115,7 @@ def is_valid_origin(origin, project=None):
return True
continue

if valid.startswith('*.'):
if valid[:2] == '*.':
# check foo.domain.com and domain.com
if parsed.hostname.endswith(valid[1:]) or parsed.hostname == valid[2:]:
return True
Expand Down

0 comments on commit 68867da

Please sign in to comment.