Feature(custom): allow localhost access for IPv6 in POST request handling

This commit is contained in:
Kuingsmile
2026-05-09 11:32:43 +08:00
parent 14dfd57dc9
commit a4a2fb913c

View File

@@ -91,7 +91,7 @@ class Server {
const remoteAddress = request.socket.remoteAddress || 'unknown'
logger.info('[PicList Server] get a POST request from IP:', remoteAddress)
let urlSP = query ? new URLSearchParams(query) : undefined
if (remoteAddress === '::1' || remoteAddress === '127.0.0.1') {
if (remoteAddress === '::1' || remoteAddress === '127.0.0.1' || remoteAddress === '::ffff:127.0.0.1') {
const serverKey = picgo.getConfig<string>(configPaths.settings.serverKey) || ''
if (urlSP) {
urlSP.set('key', serverKey)