mirror of
https://github.com/openwrt/luci.git
synced 2025-12-21 19:14:34 +04:00
luci-lib-httpclient: accept scoped IPv6 addresses
Ref: https://github.com/openwrt/luci/issues/3380 Signed-off-by: Jo-Philipp Wich <jo@mein.io>
This commit is contained in:
@@ -105,10 +105,10 @@ function parse_url(uri)
|
|||||||
rest = tmp
|
rest = tmp
|
||||||
end
|
end
|
||||||
|
|
||||||
url.host, tmp = rest:match("^%[([0-9a-fA-F:]+)%](.*)$")
|
url.host, tmp = rest:match("^%[(.+)%](.*)$")
|
||||||
if url.host and tmp then
|
if url.host and tmp then
|
||||||
url.ip6addr = ip.IPv6(url.host)
|
url.ip6addr = ip.IPv6(url.host)
|
||||||
if not url.ip6addr then
|
if not url.ip6addr or url.ip6addr:prefix() < 128 then
|
||||||
return nil
|
return nil
|
||||||
end
|
end
|
||||||
url.host = string.format("[%s]", url.ip6addr:string())
|
url.host = string.format("[%s]", url.ip6addr:string())
|
||||||
|
|||||||
Reference in New Issue
Block a user