Added support for custom git http user agent and header #110
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.
Some environments (especially in larger enterprise) might require additional authentication credentials via http headers or cookies . In my case one needs to send an additional cookie for each request which is obtained via multi-factor-auth. I have seen similar cases for others (see also here [1]). With git this is normally easy to achieve using the http.extraheader config option. I added a small hook to be able to set this via system environment variable. I also initially thought about adding this as part of the preferences or authentication dialog but since this is kind of special feature and the MFA cookie might change every day it is probable the easiest way to go via env variables.
In addition I also added a similar feature for the http user agent since our reverse proxy configuration does not seem to allow JGit user agents.
[1] https://www.eclipse.org/forums/index.php/t/1072183/