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

Http input plugin "Content-Type: application/json; charset=utf-8" not working #5062

Closed
jamesstojan1 opened this issue Mar 11, 2022 · 2 comments · Fixed by #9190 · May be fixed by #6864
Closed

Http input plugin "Content-Type: application/json; charset=utf-8" not working #5062

jamesstojan1 opened this issue Mar 11, 2022 · 2 comments · Fixed by #9190 · May be fixed by #6864

Comments

@jamesstojan1
Copy link

Describe the bug
The Http input plugin rejects json when the content type when a charset is included. Given that the parser is expecting utf8 json it isn't unreasonable to allow it as the character set.

To Reproduce
Config
[INPUT] name http host 0.0.0.0 port 5170

Post message
curl --location --request POST 'http://localhost:5170' \ --header 'Content-Type: application/json; charset=utf-8' \ --data-raw '{ "log": "some log entry" } '

Get error message "error: invalid 'Content-Type'"

Expected behavior
That the http request would be accepted and processed

Additional context
Allowing charset=utf-8 would make the http input plugin more flexible especially when working with applications that automatically set the character set.

You can work around this of course by removing the charset from the header.

@github-actions
Copy link
Contributor

This issue is stale because it has been open 90 days with no activity. Remove stale label or comment or this will be closed in 5 days. Maintainers can add the exempt-stale label.

@github-actions
Copy link
Contributor

This issue was closed because it has been stalled for 5 days with no activity.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment