mirror of
https://github.com/whyour/qinglong.git
synced 2026-07-01 04:40:38 +08:00
webhook 通知 body 增加 text/plain 类型,修复多定时任务服务重启未初始化
This commit is contained in:
+8
-3
@@ -61,7 +61,8 @@ export async function getNetIp(req: any) {
|
||||
...req.ips,
|
||||
req.socket.remoteAddress,
|
||||
]),
|
||||
];
|
||||
].filter(Boolean);
|
||||
|
||||
let ip = ipArray[0];
|
||||
|
||||
if (ipArray.length > 1) {
|
||||
@@ -82,6 +83,7 @@ export async function getNetIp(req: any) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
ip = ip.substr(ip.lastIndexOf(':') + 1, ip.length);
|
||||
if (ip.includes('127.0') || ip.includes('192.168') || ip.includes('10.7')) {
|
||||
ip = '';
|
||||
@@ -347,9 +349,12 @@ export function parseBody(
|
||||
contentType:
|
||||
| 'application/json'
|
||||
| 'multipart/form-data'
|
||||
| 'application/x-www-form-urlencoded',
|
||||
| 'application/x-www-form-urlencoded'
|
||||
| 'text/plain',
|
||||
) {
|
||||
if (!body) return '';
|
||||
if (contentType === 'text/plain' || !body) {
|
||||
return body;
|
||||
}
|
||||
|
||||
const parsed: any = {};
|
||||
let key;
|
||||
|
||||
Reference in New Issue
Block a user