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

fix: 修复uni.request在ssr环境下content-type识别不正确的Bug

上级 ce0baa7e
......@@ -111,6 +111,13 @@ function normalizeContentType(header: Record<string, string>) {
return
}
const contentType = header[name]
//#if _NODE_JS_
// xmlhttprequest 不能正确识别 content-type
if (name !== 'Content-Type') {
header['Content-Type'] = header[name]
delete header[name]
}
//#endif
if (contentType.indexOf('application/json') === 0) {
return 'json'
} else if (contentType.indexOf('application/x-www-form-urlencoded') === 0) {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册