-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
Labels
Comments
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 |
6 tasks
This issue was closed because it has been stalled for 5 days with no activity. |
demonccc
pushed a commit
to demonccc/fluent-bit
that referenced
this issue
Feb 14, 2023
… Reference: fluent#5062 Signed-off-by: a445943 <[email protected]>
This was referenced Feb 14, 2023
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
The text was updated successfully, but these errors were encountered: