If PATH_INFO is empty, the percent encoded path info is also empty. No need for complex computation.

Note this fixes an issue with libfcgi app not hosted as root url such as "/sub/app.fcgi".
This commit is contained in:
2017-01-10 00:16:50 +01:00
parent 9f04c52265
commit ee9746449c

View File

@@ -838,6 +838,10 @@ feature -- Access: CGI meta parameters - 1.1
do do
l_result := internal_percent_encoded_path_info l_result := internal_percent_encoded_path_info
if l_result = Void then if l_result = Void then
pi := path_info
if pi.is_empty then
l_result := ""
else
r := request_uri r := request_uri
i := r.index_of ('?', 1) i := r.index_of ('?', 1)
if i > 0 then if i > 0 then
@@ -845,7 +849,6 @@ feature -- Access: CGI meta parameters - 1.1
else else
l_result := r.string l_result := r.string
end end
pi := path_info
i := 0 i := 0
if pi.is_valid_as_string_8 then if pi.is_valid_as_string_8 then
i := l_result.substring_index (pi.to_string_8, 1) i := l_result.substring_index (pi.to_string_8, 1)
@@ -884,6 +887,7 @@ feature -- Access: CGI meta parameters - 1.1
end end
end end
end end
end
internal_percent_encoded_path_info := l_result internal_percent_encoded_path_info := l_result
end end
Result := l_result Result := l_result