Skip to content

Commit

Permalink
more reliable parsing of hostname from prod_url
Browse files Browse the repository at this point in the history
- do not require https
- allow for port specification, and paths
  • Loading branch information
svigerske committed Aug 13, 2024
1 parent 2ba5795 commit c7f3545
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion rubberband/boilerplate.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
"""Define variables and setup rubberband app."""
import os
import logging
from urllib.parse import urlparse

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

logging.info("Setting up Elasticsearch connection.")
Expand Down

0 comments on commit c7f3545

Please sign in to comment.