Merge pull request #6105 from minrk/default_allow_origin_pat

only set allow_origin_pat if defined
This commit is contained in:
Min RK 2014-07-09 20:33:44 -05:00
commit 3ff6a8f596

View File

@ -678,6 +678,7 @@ class NotebookApp(BaseIPythonApplication):
def init_webapp(self): def init_webapp(self):
"""initialize tornado webapp and httpserver""" """initialize tornado webapp and httpserver"""
self.webapp_settings['allow_origin'] = self.allow_origin self.webapp_settings['allow_origin'] = self.allow_origin
if self.allow_origin_pat:
self.webapp_settings['allow_origin_pat'] = re.compile(self.allow_origin_pat) self.webapp_settings['allow_origin_pat'] = re.compile(self.allow_origin_pat)
self.webapp_settings['allow_credentials'] = self.allow_credentials self.webapp_settings['allow_credentials'] = self.allow_credentials