From 04772d4f08b37c68af6c6bde6955c087f1339057 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?B=C5=82a=C5=BCej=20Cegie=C5=82ka?= Date: Thu, 28 May 2020 12:27:45 +0100 Subject: [PATCH] Allow ip subdomain part to be prefixed with dash This is useful so sub-sub-domains can make use of wildcard certificate e.g. myapp-myenvironment-10-9-8-7.mydomain.com --- src/nip.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/nip.py b/src/nip.py index 247cfe5..819a1bd 100755 --- a/src/nip.py +++ b/src/nip.py @@ -146,7 +146,7 @@ class DynamicBackend: def handle_subdomains(self, qname): subdomain = qname[0:qname.find(self.domain) - 1] - match = re.findall('^(?:.+\.)?(\d{1,3}[-.]\d{1,3}[-.]\d{1,3}[-.]\d{1,3})$', subdomain) + match = re.findall('^(?:.+[-.])?(\d{1,3}[-.]\d{1,3}[-.]\d{1,3}[-.]\d{1,3})$', subdomain) if not match: if DEBUG: