Support for passing in Basic Auth tokens and resolve issue with HTTP/1.1 reverse proxies#118
Closed
sullivanmatt wants to merge 3 commits intosplunk:developfrom
Closed
Support for passing in Basic Auth tokens and resolve issue with HTTP/1.1 reverse proxies#118sullivanmatt wants to merge 3 commits intosplunk:developfrom
sullivanmatt wants to merge 3 commits intosplunk:developfrom
Conversation
Contributor
|
@sullivanmatt overall, the change looks great. A few notes:
|
Contributor
|
@sullivanmatt do you think you're going to pick this up again? |
Contributor
Author
|
Yikes, it's been a while, hasn't it? Yes, I do plan to pick this back up, if you don't mind leaving it open for a bit. Thanks! |
Contributor
|
Yep - no problem. Let's just rebase it on top of By the way, there was a similar change in the Ruby SDK - you can take a look there what was done. |
Contributor
Author
|
Going to close this PR and issue the PRs for connection-close and the basic auth stuff as separate issues. |
mateusz834
pushed a commit
that referenced
this pull request
Apr 15, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Forgive these two minor fixes being in the same PR. I discovered the HTTP/1.1 proxy issue while working on testing my changes for Basic Auth.
Support for passing in Basic Auth tokens
This pull request modifies the way Splunk handles user-specified tokens. Currently, tokens that don't start with 'Splunk' get this prefix automatically inserted. This clobbers any Basic Auth tokens that the user has previously explicitly passed in:
Resolve issue with HTTP/1.1 reverse proxies
The Splunk SDK uses the built-in Python library
httplibfor making HTTP connections. This library does not support the use of HTTP/1.1Connection: keep-alive. When used in its default mode, the request headerConnection: closeis automatically added to ensure compatibility with servers isn't broken. However the Splunk library passes in its own headers without a Connection declaration. Normally this isn't a problem, as the splunkd server running on 8089 does not supportkeep-aliveeither and just assumes the behavior to beclose.However if using a reverse proxy in front of this service, major issues arise because the SDK is not conforming to the HTTP/1.1 header spec, RFC2616 Section 14.10:
In my testing (nginx and Apache2), Splunk SDK would receive an empty response on all GET requests and fail. With this change, all requests proceed as expected.