luci-lib-httpclient: accept scoped IPv6 addresses
Ref: https://github.com/openwrt/luci/issues/3380
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
(cherry picked from commit d87169c0f6
)
This commit is contained in:
parent
1d2b4c777f
commit
af5d665a70
1 changed files with 2 additions and 2 deletions
|
@ -105,10 +105,10 @@ function parse_url(uri)
|
|||
rest = tmp
|
||||
end
|
||||
|
||||
url.host, tmp = rest:match("^%[([0-9a-fA-F:]+)%](.*)$")
|
||||
url.host, tmp = rest:match("^%[(.+)%](.*)$")
|
||||
if url.host and tmp then
|
||||
url.ip6addr = ip.IPv6(url.host)
|
||||
if not url.ip6addr then
|
||||
if not url.ip6addr or url.ip6addr:prefix() < 128 then
|
||||
return nil
|
||||
end
|
||||
url.host = string.format("[%s]", url.ip6addr:string())
|
||||
|
|
Loading…
Reference in a new issue