Skip to content

Commit

Permalink
Fix directory website redirection
Browse files Browse the repository at this point in the history
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 <[email protected]>
  • Loading branch information
wom-bat committed Oct 9, 2024
1 parent b559878 commit 8ddd5d3
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion examples/webserver/webserver.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down

0 comments on commit 8ddd5d3

Please sign in to comment.