openwrt_helloworld/lua-neturl/patches/010-userinfo-regex.patch
Tianling Shen d573889b19 lua-neturl: fix regex
Signed-off-by: Tianling Shen <cnsztl@immortalwrt.org>
2023-01-24 14:55:11 +08:00

21 lines
538 B
Diff

--- a/lib/net/url.lua
+++ b/lib/net/url.lua
@@ -340,7 +340,7 @@ function M:setAuthority(authority)
self.password = v
return ''
end)
- if string.find(userinfo, "^[%w%+%.]+$") then
+ if string.find(userinfo, "^[%p%w%+%.]+$") then
self.user = userinfo
else
-- incorrect userinfo
@@ -369,7 +369,7 @@ function M.parse(url)
comp.fragment = v
return ''
end)
- url =url:gsub('^([%w][%w%+%-%.]*)%:', function(v)
+ url =url:gsub('^([%w][%w%+%-%_%.]*)%:', function(v)
comp.scheme = v:lower()
return ''
end)