#23022 Allow content-type header if it only includes application/json… #23023
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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
Is this a breaking change?
How did you test this PR?
Tested locally with new build
Request on new version:$MY_TOKEN" -H "X-Splunk-Request-Channel: $ (uuidgen)" -H 'Content-Type: application/json' --data '{"acks":[0]}' && echo
`curl -i -X POST "$MY_SERVER" -H "Authorization: Splunk
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:$MY_TOKEN" -H "X-Splunk-Request-Channel: $ (uuidgen)" -H 'Content-Type: application/json' --data '{"acks":[0]}' && echo
`curl -i -X POST "$MY_SERVER" -H "Authorization: Splunk
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?
References
Closes #23022