From 8ddd5d38d11c00265a40aecb87ca3ea278fc7d17 Mon Sep 17 00:00:00 2001 From: Peter Chubb Date: Wed, 9 Oct 2024 13:24:15 +1100 Subject: [PATCH] Fix directory website redirection When a URL referred to a directory, the webserver is meant to redirect to one with a trailing slash. However it was returning a relative path, so, for example, https://sel4.org/Foundation/Summit redirected to https://sel4.org/Foundation/Summit/Foundation/summit/ Make it an absolute path. Signed-off-by: Peter Chubb --- examples/webserver/webserver.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/webserver/webserver.py b/examples/webserver/webserver.py index 646235a1..579aed8a 100644 --- a/examples/webserver/webserver.py +++ b/examples/webserver/webserver.py @@ -127,7 +127,7 @@ async def try_suffices(path, suffices): # exists, and we did not find any files with the name suffixed # by a standard extension, so redirect the client to the form # with appropriate trailing slash. - return 301, f'{relative_path}/', None + return 301, f'/{relative_path}/', None return 404, None, None