From d8df047d2441538cba702558172b7b20b427089c Mon Sep 17 00:00:00 2001 From: Jimmy Berry Date: Fri, 10 May 2019 11:44:18 -0500 Subject: [PATCH 1/2] obs_operator: handle multi-level origin domains. --- obs_operator.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/obs_operator.py b/obs_operator.py index 6e91d47a..3a4841df 100755 --- a/obs_operator.py +++ b/obs_operator.py @@ -144,7 +144,7 @@ class RequestHandler(BaseHTTPRequestHandler): # Strip port if present. domain = urlparse(origin).netloc.split(':', 2)[0] if '.' in domain: - return '.'.join(domain.split('.')[1:]) + return '.'.join(domain.split('.')[-2:]) return None From 74eb4a3955c861ea5e554cd140571e76bcca0eee Mon Sep 17 00:00:00 2001 From: Jimmy Berry Date: Fri, 10 May 2019 11:53:28 -0500 Subject: [PATCH 2/2] obs_operator: handle multi-level host domains. --- obs_operator.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/obs_operator.py b/obs_operator.py index 3a4841df..1679e6a4 100755 --- a/obs_operator.py +++ b/obs_operator.py @@ -135,7 +135,7 @@ class RequestHandler(BaseHTTPRequestHandler): return None # Remove first subdomain and replace with api subdomain. - domain_parent = '.'.join(domain.split('.')[1:]) + domain_parent = '.'.join(domain.split('.')[-2:]) return 'https://api.{}'.format(domain_parent) def origin_domain_get(self):