changeset 1484:6643855770a5

server: fix indentation following merge
author Goffi <goffi@goffi.org>
date Sun, 21 Nov 2021 23:20:13 +0100
parents 595e7fef41f3
children 579250dfe6d0
files libervia/server/server.py
diffstat 1 files changed, 20 insertions(+), 20 deletions(-) [+]
line wrap: on
line diff
--- a/libervia/server/server.py	Fri Nov 12 17:48:30 2021 +0100
+++ b/libervia/server/server.py	Sun Nov 21 23:20:13 2021 +0100
@@ -517,28 +517,28 @@
 
                     # normal redirection system is not used here
                     continue
-            elif new_url.scheme == "proxy":
-                # a reverse proxy
-                host, port = new_url.hostname, new_url.port
-                if host is None or port is None:
-                    raise ValueError(
-                        "invalid host or port in proxy redirection, please check your "
-                        "configuration: {new_url.geturl()}"
+                elif new_url.scheme == "proxy":
+                    # a reverse proxy
+                    host, port = new_url.hostname, new_url.port
+                    if host is None or port is None:
+                        raise ValueError(
+                            "invalid host or port in proxy redirection, please check your "
+                            "configuration: {new_url.geturl()}"
+                        )
+                    url_prefix = (new_url.path or old).rstrip('/')
+                    res = proxy.SatReverseProxyResource(
+                        host,
+                        port,
+                        url_prefix.encode(),
                     )
-                url_prefix = (new_url.path or old).rstrip('/')
-                res = proxy.SatReverseProxyResource(
-                    host,
-                    port,
-                    url_prefix.encode(),
-                )
-                self.addResourceToPath(old, res)
-                log.info(
-                    f"[{self.host_name}] Added redirection from /{old} to reverse proxy "
-                    f"{new_url.netloc} with URL prefix {url_prefix}/"
-                )
+                    self.addResourceToPath(old, res)
+                    log.info(
+                        f"[{self.host_name}] Added redirection from /{old} to reverse proxy "
+                        f"{new_url.netloc} with URL prefix {url_prefix}/"
+                    )
 
-                # normal redirection system is not used here
-                continue
+                    # normal redirection system is not used here
+                    continue
                 else:
                     raise NotImplementedError(
                         "{scheme}: scheme is not managed for url_redirections_dict".format(