Skip to content

Commit c7f3545

Browse files
committed
more reliable parsing of hostname from prod_url
- do not require https - allow for port specification, and paths
1 parent 2ba5795 commit c7f3545

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

rubberband/boilerplate.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
"""Define variables and setup rubberband app."""
22
import os
33
import logging
4+
from urllib.parse import urlparse
45

56
from tornado.options import define, options
67
from tornado.web import Application
@@ -89,7 +90,7 @@ def make_app(project_root):
8990
# default: app = Application(routes, **settings)
9091
app = Application(
9192
[(HostMatches(r'(localhost|127\.0\.0\.1|{}|)'.format(
92-
options.prod_url.replace("https://", ""))), routes)],
93+
urlparse(options.prod_url).hostname)), routes)],
9394
**settings)
9495

9596
logging.info("Setting up Elasticsearch connection.")

0 commit comments

Comments
 (0)