From 49881b64297c4ef80707b316761381d1e8df6af6 Mon Sep 17 00:00:00 2001 From: Jocelyn Fiat Date: Wed, 26 Feb 2020 22:46:03 +0100 Subject: [PATCH] Better handling for directory default index response (for instance index.html) for case like "/subdir" which is now redirected to "/subdir/" so relative url are correctly handled. --- library/server/wsf/router/wsf_file_system_handler.e | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/library/server/wsf/router/wsf_file_system_handler.e b/library/server/wsf/router/wsf_file_system_handler.e index 1bbad21c..38fd3826 100644 --- a/library/server/wsf/router/wsf_file_system_handler.e +++ b/library/server/wsf/router/wsf_file_system_handler.e @@ -221,8 +221,10 @@ feature -- Execution if f.is_directory then if index_disabled then process_directory_index_disabled (uri, req, res) + elseif uri.ends_with ("/") then + process_index (uri, fn, req, res) else - process_index (req.request_uri, fn, req, res) + res.redirect_now (uri + "/") end else process_file (f, req, res) @@ -652,7 +654,7 @@ feature {NONE} -- implementation: date time end note - copyright: "2011-2017, Jocelyn Fiat, Javier Velilla, Olivier Ligot, Colin Adams, Eiffel Software and others" + copyright: "2011-2019, Jocelyn Fiat, Javier Velilla, Olivier Ligot, Colin Adams, Eiffel Software and others" license: "Eiffel Forum License v2 (see http://www.eiffel.com/licensing/forum.txt)" source: "[ Eiffel Software