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.

This commit is contained in:
2020-02-26 22:46:03 +01:00
parent c76e1a785c
commit 49881b6429

View File

@@ -221,8 +221,10 @@ feature -- Execution
if f.is_directory then if f.is_directory then
if index_disabled then if index_disabled then
process_directory_index_disabled (uri, req, res) process_directory_index_disabled (uri, req, res)
elseif uri.ends_with ("/") then
process_index (uri, fn, req, res)
else else
process_index (req.request_uri, fn, req, res) res.redirect_now (uri + "/")
end end
else else
process_file (f, req, res) process_file (f, req, res)
@@ -652,7 +654,7 @@ feature {NONE} -- implementation: date time
end end
note 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)" license: "Eiffel Forum License v2 (see http://www.eiffel.com/licensing/forum.txt)"
source: "[ source: "[
Eiffel Software Eiffel Software