From 304451ef7cab6fb0c09acb9254046c7247775197 Mon Sep 17 00:00:00 2001 From: Liam Date: Wed, 28 Aug 2024 02:46:46 +0100 Subject: [PATCH] fixes --- src/command/impl/addSubPathCommand.py | 2 +- src/traefik/traefikConfig.py | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/src/command/impl/addSubPathCommand.py b/src/command/impl/addSubPathCommand.py index 81f65d2..963d3b2 100644 --- a/src/command/impl/addSubPathCommand.py +++ b/src/command/impl/addSubPathCommand.py @@ -39,4 +39,4 @@ class AddSubPathCommand(Command): traefikConfig.addSubPathRouter(subPathName, domain, path, serviceHost) traefikConfig.save() - print(f"Access your service at http://{domain}") \ No newline at end of file + print(f"Access your service at http://{domain}{path}") \ No newline at end of file diff --git a/src/traefik/traefikConfig.py b/src/traefik/traefikConfig.py index 0628b1f..bea1a82 100644 --- a/src/traefik/traefikConfig.py +++ b/src/traefik/traefikConfig.py @@ -75,6 +75,9 @@ class TraefikConfig: return name in self.configYml["http"]["middlewares"] def addPathRewrite(self, name, path): + if not path.endswith("/"): # Add trailing slash + path += "/" + self.configYml["http"]["middlewares"][name] = { "stripPrefix": { "prefixes": [path]