提交 3be2f558 编写于 作者: 雪洛's avatar 雪洛

fix: 修复content-type未忽略大小写的Bug

上级 f0eac13d
......@@ -100,7 +100,14 @@ class RequestTask {
}
export function request (args, callbackId) {
if (args.method !== 'GET' && args.header['Content-Type'].indexOf('application/json') === 0 && isPlainObject(args.data)) {
let contentType
for (const name in args.header) {
if (name.toLowerCase() === 'content-type') {
contentType = args.header[name]
break
}
}
if (args.method !== 'GET' && contentType.indexOf('application/json') === 0 && isPlainObject(args.data)) {
args.data = JSON.stringify(args.data)
}
const {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册