Merge pull request #263 from Ariesly/ipv6-uri

fix: Handles node-info IPv6 address URIs
This commit is contained in:
xream 2023-12-29 15:39:03 +08:00 committed by GitHub
commit 45772ade4d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -22,7 +22,10 @@ async function getNodeInfo(req, res) {
const info = await $http
.get({
url: `http://ip-api.com/json/${encodeURIComponent(
proxy.server,
proxy.server
.trim()
.replace(/^\[/, '')
.replace(/\]$/, '')
)}?lang=${lang}`,
headers: {
'User-Agent':