Skip to content

Commit

Permalink
Merge pull request #1276 from benallard/patch-1
Browse files Browse the repository at this point in the history
www: Set a sensible default for the allowed_origins
  • Loading branch information
Mikhail Sobolev committed Oct 21, 2014
2 parents 32a8eba + 0f5adc4 commit 130751b
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion master/buildbot/www/rest.py
Expand Up @@ -361,9 +361,12 @@ def writeError(msg, errcode=404, jsonrpccode=None):
request.write(data)

def reconfigResource(self, new_config):
# www['url'] will always ends with a '/', not the Origin header.
origin_self = new_config.www['url'].rstrip('/')
# pre-translate the origin entries in the config
self.origins = [re.compile(fnmatch.translate(o.lower()))
for o in new_config.www.get('allowed_origins', [])]
for o in new_config.www.get('allowed_origins',
[origin_self])]

# and copy some other flags
self.debug = new_config.www.get('debug')
Expand Down

0 comments on commit 130751b

Please sign in to comment.