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

in_http: Content-Type rejected for application/json when encoding value is present. #9190

Merged
merged 3 commits into from
Aug 14, 2024

Conversation

metalfork
Copy link
Contributor

Summary

  • Updated http_prot to handle json content type header with charset.
  • Include guard for content types that maybe be a flavor of application/json but of an unknown/unsupported content type.
  • Includes in_http runtime tests.

Current issue: #9018
Other issue related to this PR fix #5062


Enter [N/A] in the box, if an item is not applicable to your change.

Testing
Before we can approve your change; please submit the following in a comment:

  • [ N/A] Example configuration file for the change
  • [N/A ] Debug log output from testing the change
  • [ N/A] Attached Valgrind output that shows no leaks or memory corruption was found

If this is a change to packaging of containers or native binaries then please confirm it works for all targets.

  • [N/A ] Run local packaging test showing all targets (including any new ones) build.
  • [N/A] Set ok-package-test label to test for all targets (requires maintainer to do).

Documentation

  • [N/A] Documentation required for this feature

Backporting

  • [N/A] Backport to latest stable release.

Fluent Bit is licensed under Apache 2.0, by submitting this pull request I understand that this code will be released under the terms of that license.

…cludes guard for content types that maybe be a flavor of application/json but of an unknown/unsupported type. Included in_http runtime tests.

Signed-off-by: metalfork <cwagner@cardfree.com>
@metalfork
Copy link
Contributor Author

@patrick-stephens @pwhelan Per comment I've opened a new/clean PR.

@metalfork metalfork changed the title Updated http_prot to handle json content type header with charset. In… in_http: Content-Type rejected for application/json when encoding value is present. Aug 12, 2024
plugins/in_http/http_prot.c Outdated Show resolved Hide resolved
…without.

Signed-off-by: metalfork <cwagner@cardfree.com>
Copy link
Collaborator

@leonardo-albertovich leonardo-albertovich left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It looks good to me, if you don't mind one more minor thing, could you please break the lines to comply with the 80 column coding style rule?

I'm ok with doing it myself afterwards if you don't want to but it'd be helpful to avoid adding noise to the change history.

Thanks for your cooperation, you've been a trooper =)

Signed-off-by: metalfork <cwagner@cardfree.com>
@edsiper edsiper merged commit 1fe1392 into fluent:master Aug 14, 2024
41 of 42 checks passed
@metalfork
Copy link
Contributor Author

@patrick-stephens @pwhelan unfortunately these changes don't seem to work.

Results of some local tests. I'll get a development environment up and running on my end in a few days and write some new tests that fail based on these results and then update the implementation so they pass. Then submit a new PR. Note I am low on personal bandwidth at the moment.

- Works "application/json"
- Doesn't work "application/json;"
- Doesn't work "application/json "
- Doesn't work "application/json;charset=utf-8"

CC @edsiper @leonardo-albertovich @sandersonCF @Ashwin9714

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

Successfully merging this pull request may close these issues.

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