Last active
August 15, 2017 21:01
-
-
Save sirbrillig/b1ded3a4a9824b8f11746f05c5d7eeda to your computer and use it in GitHub Desktop.
wpcom-xhr-request: Prevent sending body if formData is set
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/index.js b/index.js | |
index 9db01ce..165d708 100644 | |
--- a/index.js | |
+++ b/index.js | |
@@ -162,7 +162,7 @@ export default function request( options, fn ) { | |
} | |
// body | |
- if ( body ) { | |
+ if ( body && ! formData ) { | |
req.send( body ); | |
debug( 'API send POST body: %o', body ); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment