Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix allow_origin_pat property to properly parse regex #603

Merged
merged 2 commits into from
Nov 2, 2021
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion jupyter_server/base/handlers.py
Original file line number Diff line number Diff line change
Expand Up @@ -295,7 +295,8 @@ def allow_origin(self):
@property
def allow_origin_pat(self):
"""Regular expression version of allow_origin"""
return self.settings.get("allow_origin_pat", None)
pat_str = self.settings.get("allow_origin_pat", None)
return re.compile(pat_str) if pat_str else None

@property
def allow_credentials(self):
Expand Down