mirror of
https://github.com/Kuingsmile/PicList.git
synced 2026-05-22 00:30:33 +08:00
✨ Feature(custom): allow localhost access for IPv6 in POST request handling
This commit is contained in:
@@ -91,7 +91,7 @@ class Server {
|
|||||||
const remoteAddress = request.socket.remoteAddress || 'unknown'
|
const remoteAddress = request.socket.remoteAddress || 'unknown'
|
||||||
logger.info('[PicList Server] get a POST request from IP:', remoteAddress)
|
logger.info('[PicList Server] get a POST request from IP:', remoteAddress)
|
||||||
let urlSP = query ? new URLSearchParams(query) : undefined
|
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) || ''
|
const serverKey = picgo.getConfig<string>(configPaths.settings.serverKey) || ''
|
||||||
if (urlSP) {
|
if (urlSP) {
|
||||||
urlSP.set('key', serverKey)
|
urlSP.set('key', serverKey)
|
||||||
|
|||||||
Reference in New Issue
Block a user