Introduce 'ExtraHeaders' capability across all Commands #21
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.
Hey, I have a situation where I want to include a nonstandard HTTP header on Jenkins requests which authorize them to get past a firewalling proxy.
I didn't see a way to attach custom headers using this library so I added an extension point in this PR to accept arbitrary key/value pairs at the JenkinsClient level.
I'm not sure if there's a decent way to test this, as it seems the tests assume a localhost Jenkins, and Rider isn't hooking up to xUnit for me to begin with. Perhaps the best way to test this change would be manually constructing and passing an
Authorizationheader instead of passingUsernameandApiToken(so,Authorization: Basic Z3Vlc3Q6YmNiOTU0YTc3YWI0Nzc1MDIwMWE5ZjE4OGIxYjI1ZTg=)Indeed, this PR offers a superset of the Username/ApiToken functionality.
A possible different approach could be allowing a global OnWrite callback. Even more flexible but also easier to go wrong