-
Notifications
You must be signed in to change notification settings - Fork 25
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix: issue where formData would sometimes be sent twice #389
Conversation
@@ -131,6 +132,7 @@ module.exports = async (operation, body, metadata) => { | |||
// as a metadata object and organize into parameters. | |||
// eslint-disable-next-line no-param-reassign | |||
metadata = body; | |||
metadataIntersected = true; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Open to suggestions on a better variable name than this. Basically I just need to know when body
was copied to metadata
, where what the user sent was a metadata object but since they didn't send a body, and body
is the first argument to an operation we need to rewrite it a bit.
It's confusing I know and I'm not explaining it properly.
🧰 Changes
This resolves a bug I discovered in #380 where if you sent only a metadata object to an
x-www-form-urlencoded
opration we'd copy that metadata over to being theformData
object, ultimately potentially things like path parameters in the body payload.🧬 QA & Testing
See the test I added for this and the test I updated that had this incorrect behavior as an expectation. Oops.