diff --git a/package.json b/package.json index 1e61b59..ffc1030 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@bytedo/fetch", - "version": "2.1.2", + "version": "2.1.3", "description": "全新的ajax封装。分2个版本, 一个基于XMLHttpRequest, 一个基于window.fetch", "main": "dist/index.js", "files": [ diff --git a/src/index.js b/src/index.js index b5456b2..5d59ca6 100644 --- a/src/index.js +++ b/src/index.js @@ -146,7 +146,10 @@ class _Request { } } } + } else { + delete options.headers['content-type'] } + if (hasAttach) { delete options.headers['content-type'] } diff --git a/src/next.js b/src/next.js index 49ce53d..f7a4bfa 100644 --- a/src/next.js +++ b/src/next.js @@ -122,7 +122,10 @@ class _Request { } break } + } else { + delete options.headers['content-type'] } + if (hasAttach) { delete options.headers['content-type'] }