EDGE: Normalize fsbrowser URI if there is no trailing part
-- See the License for the specific language governing permissions and
-- limitations under the License.
+local function is_empty(s)
+ return s == nil or s == ''
+end
+
local function is_int(n)
return tonumber(n) ~= nil
end
@@ -127,10 +131,15 @@ if token then
local trailing_req_uri = ''
if (uri_parts_len > 0) then
trailing_req_uri = arr_to_string(uri_parts, '/')
+ -- Do not add a trailing slash to the URIs with parameters
if not string.match(trailing_req_uri, '?') then
trailing_req_uri = trailing_req_uri .. '/'
end
end
+ -- Normalize URI if there is no trailing part
+ if is_empty(trailing_req_uri) then
+ trailing_req_uri = '/'
+ end
-- Now we need to get the target IP (i.e. Pod IP) and the access token
-- (i.e. defined by the SSH_PASS, which available only to ADMINs and OWNERs)
