-
-
Notifications
You must be signed in to change notification settings - Fork 4.2k
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
[bug]: Setting body type to none sets the content type in the request to application/x-www-form-urlencoded #3685 #3906
base: main
Are you sure you want to change the base?
Conversation
… to application/x-www-form-urlencoded hoppscotch#3685
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.
Look into this issue
|
||
// When the user clicks to change the content type | ||
@click=" | ||
() => { | ||
// If the selected content type is 'none' | ||
if (contentTypeItem === 'none') { | ||
// Set the body.contentType to null | ||
body.contentType = null | ||
// And remove the 'Content-Type' header | ||
headers.value = headers.value.filter(header => header.key.toLowerCase() !== 'content-type'); | ||
} else { | ||
// Otherwise, set the body.contentType as usual | ||
body.contentType = contentTypeItem | ||
} | ||
hide() | ||
} |
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.
You have included Vue template code inside the script tag. Please revise your pull request.
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.
Thank you for your feedback. I’ve moved the Vue template code from the <script> tag to the tag as suggested. Please review the updated code.
… to application/x-www-form-urlencoded hoppscotch#3685
… to application/x-www-form-urlencoded hoppscotch#3685
@ialloyd, I could not reproduce the issue. I see it's working completely fine. Can you please tell me the process to reproduce this issue? |
This PR addresses an issue where the 'Content-Type' header was incorrectly set to 'application/x-www-form-urlencoded' when the body type was set to 'none'. The changes ensure that the 'Content-Type' header is removed as expected in this scenario.
I would appreciate if you could review the changes and provide your valuable feedback. Thank you!