Skip to content
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

Support arbitrary headers with HTTP datasources #115

Merged
merged 1 commit into from
Apr 13, 2017

Conversation

hairyhenderson
Copy link
Owner

Fixes #113

Adds new a command-line option --datasource-header/-H, which allows sending custom headers when accessing HTTP[S] datasources. For example:

$ gomplate -d foo=https://httpbin.org/get -H 'foo=Foo: bar' -i '{{(datasource "foo").headers.Foo}}'
bar

This can be used e.g. for authentication, by setting the Authorization or related headers...

Signed-off-by: Dave Henderson dhenderson@gmail.com

Signed-off-by: Dave Henderson <dhenderson@gmail.com>
@hairyhenderson hairyhenderson merged commit af03642 into master Apr 13, 2017
@hairyhenderson hairyhenderson deleted the add-datasource-header-flag-113 branch April 13, 2017 03:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant