Skip to content
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

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

ialloyd
Copy link

@ialloyd ialloyd commented Mar 18, 2024

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!

Copy link
Member

@anwarulislam anwarulislam left a 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

Comment on lines 193 to 208

// 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()
}
Copy link
Member

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.

Copy link
Author

@ialloyd ialloyd Mar 21, 2024

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.

@anwarulislam
Copy link
Member

@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?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants