This commit is contained in:
Julio César Suástegui 2026-08-26 13:49:25 -07:00 committed by GitHub
commit b9fe2fafbd
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -199,11 +199,11 @@ function parse(url, default)
parsed.authority = n
return ""
end)
-- get params
url = string.gsub(url, "%;(.*)", function(p)
parsed.params = p
return ""
end)
-- get params (RFC 3986 s3.3: parameters are scoped to individual path
-- segments, not the entire remaining path). Capture the first occurrence
-- and strip all occurrences so the path is reconstructed correctly.
parsed.params = url:match("%;([^/]*)")
url = url:gsub("%;[^/]*", "")
-- path is whatever was left
parsed.path = url