Skip to content

Instantly share code, notes, and snippets.

@sirbrillig
Last active August 15, 2017 21:01
Show Gist options
  • Save sirbrillig/b1ded3a4a9824b8f11746f05c5d7eeda to your computer and use it in GitHub Desktop.
Save sirbrillig/b1ded3a4a9824b8f11746f05c5d7eeda to your computer and use it in GitHub Desktop.
wpcom-xhr-request: Prevent sending body if formData is set
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