mirror of
https://github.com/whyour/qinglong.git
synced 2025-05-23 14:56:07 +08:00
修复 text/plain 通知消息替换
This commit is contained in:
parent
2e7f3a1578
commit
510534ee0c
|
@ -399,7 +399,7 @@ export function parseBody(
|
||||||
valueFormatFn?: (v: string) => string,
|
valueFormatFn?: (v: string) => string,
|
||||||
) {
|
) {
|
||||||
if (contentType === 'text/plain' || !body) {
|
if (contentType === 'text/plain' || !body) {
|
||||||
return body;
|
return valueFormatFn && body ? valueFormatFn(body) : body;
|
||||||
}
|
}
|
||||||
|
|
||||||
const parsed = parseString(body, valueFormatFn);
|
const parsed = parseString(body, valueFormatFn);
|
||||||
|
|
|
@ -1379,7 +1379,7 @@ function parseHeaders(headers) {
|
||||||
|
|
||||||
function parseBody(body, contentType, valueFormatFn) {
|
function parseBody(body, contentType, valueFormatFn) {
|
||||||
if (contentType === 'text/plain' || !body) {
|
if (contentType === 'text/plain' || !body) {
|
||||||
return body;
|
return valueFormatFn && body ? valueFormatFn(body) : body;
|
||||||
}
|
}
|
||||||
|
|
||||||
const parsed = parseString(body, valueFormatFn);
|
const parsed = parseString(body, valueFormatFn);
|
||||||
|
|
|
@ -766,7 +766,7 @@ def parse_string(input_string, value_format_fn=None):
|
||||||
|
|
||||||
def parse_body(body, content_type, value_format_fn=None):
|
def parse_body(body, content_type, value_format_fn=None):
|
||||||
if not body or content_type == "text/plain":
|
if not body or content_type == "text/plain":
|
||||||
return body
|
return value_format_fn(body) if value_format_fn and body else body
|
||||||
|
|
||||||
parsed = parse_string(body, value_format_fn)
|
parsed = parse_string(body, value_format_fn)
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user