piclist 1.8.2 → 1.8.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/bin/picgo-server +11 -2
- package/dist/index.cjs.js +2 -2
- package/dist/index.esm.js +2 -2
- package/dist/plugins/uploader/utils.d.ts +7 -0
- package/package.json +2 -2
package/bin/picgo-server
CHANGED
|
@@ -359,6 +359,15 @@ class Server {
|
|
|
359
359
|
}
|
|
360
360
|
})
|
|
361
361
|
} else {
|
|
362
|
+
let urlSP = query ? new URLSearchParams(query) : undefined
|
|
363
|
+
console.log('[PicList Server] get the request from IP:', request.socket.remoteAddress)
|
|
364
|
+
if (request.socket.remoteAddress === '127.0.0.1' || request.socket.remoteAddress === '::1') {
|
|
365
|
+
if (urlSP) {
|
|
366
|
+
urlSP.set('key', key)
|
|
367
|
+
} else {
|
|
368
|
+
urlSP = new URLSearchParams('key=' + key)
|
|
369
|
+
}
|
|
370
|
+
}
|
|
362
371
|
if (request.headers['content-type'] && request.headers['content-type'].startsWith('multipart/form-data')) {
|
|
363
372
|
uploadMulter.any()(request, response, err => {
|
|
364
373
|
if (err) {
|
|
@@ -379,7 +388,7 @@ class Server {
|
|
|
379
388
|
handler({
|
|
380
389
|
list: list,
|
|
381
390
|
response,
|
|
382
|
-
urlparams:
|
|
391
|
+
urlparams:urlSP
|
|
383
392
|
})
|
|
384
393
|
}
|
|
385
394
|
})
|
|
@@ -408,7 +417,7 @@ class Server {
|
|
|
408
417
|
handler({
|
|
409
418
|
...postObj,
|
|
410
419
|
response,
|
|
411
|
-
urlparams:
|
|
420
|
+
urlparams: urlSP
|
|
412
421
|
})
|
|
413
422
|
}
|
|
414
423
|
})
|