From c7f3545c5a0777f112b4833558ef4dccbbeb5d90 Mon Sep 17 00:00:00 2001 From: Stefan Vigerske Date: Tue, 13 Aug 2024 17:10:16 +0700 Subject: [PATCH] more reliable parsing of hostname from prod_url - do not require https - allow for port specification, and paths --- rubberband/boilerplate.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/rubberband/boilerplate.py b/rubberband/boilerplate.py index 2b0ddcf..3596ced 100644 --- a/rubberband/boilerplate.py +++ b/rubberband/boilerplate.py @@ -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 @@ -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.")