File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -61,11 +61,16 @@ export default isXHRAdapterSupported && function (config) {
6161 }
6262 }
6363
64+ let contentType ;
65+
6466 if ( utils . isFormData ( requestData ) ) {
6567 if ( platform . isStandardBrowserEnv || platform . isStandardBrowserWebWorkerEnv ) {
6668 requestHeaders . setContentType ( false ) ; // Let the browser set it
67- } else {
68- requestHeaders . setContentType ( 'multipart/form-data;' , false ) ; // mobile/desktop app frameworks
69+ } else if ( ! requestHeaders . getContentType ( / ^ \s * m u l t i p a r t \/ f o r m - d a t a / ) ) {
70+ requestHeaders . setContentType ( 'multipart/form-data' ) ; // mobile/desktop app frameworks
71+ } else if ( utils . isString ( contentType = requestHeaders . getContentType ( ) ) ) {
72+ // fix semicolon duplication issue for ReactNative FormData implementation
73+ requestHeaders . setContentType ( contentType . replace ( / ^ \s * ( m u l t i p a r t \/ f o r m - d a t a ) ; + / , '$1' ) )
6974 }
7075 }
7176
You can’t perform that action at this time.
0 commit comments