Skip to content

#23022 Allow content-type header if it only includes application/json… #23023

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

Closed
wants to merge 1 commit into from

Conversation

tot19
Copy link

@tot19 tot19 commented May 10, 2025

feat: Allow content-type header if it only includes application/json for Splunk HEC source

Summary

Updated the Splunk HEC source to accept requests that contain the header content-type with any value containing "application/json," not the exact value of "application/json."

Change Type

  • Bug fix
  • [ X] New feature
  • Non-functional (chore, refactoring, docs)
  • Performance

Is this a breaking change?

  • Yes
  • [ X] No

How did you test this PR?

Tested locally with new build

Request on new version:
`curl -i -X POST "$MY_SERVER" -H "Authorization: Splunk $MY_TOKEN" -H "X-Splunk-Request-Channel: $(uuidgen)" -H 'Content-Type: application/json' --data '{"acks":[0]}' && echo
HTTP/1.1 400 Bad Request
content-type: application/json
content-length: 36
date: Sat, 10 May 2025 15:39:22 GMT

{"text":"Ack is disabled","code":14}`

Request on old version:
`curl -i -X POST "$MY_SERVER" -H "Authorization: Splunk $MY_TOKEN" -H "X-Splunk-Request-Channel: $(uuidgen)" -H 'Content-Type: application/json' --data '{"acks":[0]}' && echo
HTTP/1.1 415 Unsupported Media Type
content-type: text/plain; charset=utf-8
content-length: 43
date: Sat, 10 May 2025 09:26:39 GMT

The request's content-type is not supported`

Does this PR include user facing changes?

  • Yes. Please add a changelog fragment based on our guidelines.
  • [X ] No. A maintainer will apply the "no-changelog" label to this PR.

References

Closes #23022

@tot19 tot19 requested a review from a team as a code owner May 10, 2025 15:47
@bits-bot
Copy link

bits-bot commented May 10, 2025

CLA assistant check
All committers have signed the CLA.

@github-actions github-actions bot added the domain: sources Anything related to the Vector's sources label May 10, 2025
@tot19
Copy link
Author

tot19 commented May 10, 2025

Closing

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
domain: sources Anything related to the Vector's sources
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Splunk HEC Source - Allow content-type Header that Contains application/json
2 participants