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

accept command line arg for a custom header #64

Closed
wants to merge 1 commit into from

Conversation

lanterndev
Copy link
Contributor

This builds on @luk-'s work in #28 to allow specifying a custom header via the -H or --header command line argument.

A future change could allow for specifying more than one custom header via a --headers command line argument. It looks like optimist does not support recovering multiple passed-in -H arguments, so unfortunately emulating curl isn't an option (e.g. curl -H 'X-Foo: Bar' -H 'X-Baz: Qux' http://www.google.com/).

For now, this is definitely useful for e.g. adding an HSTS header, so I thought I'd send a pull request.

@andrefs
Copy link
Contributor

andrefs commented Oct 3, 2014

+1

This would allow, for example, to force the Content-Type of the files being served.
Useful if you're exposing some kind of file storage where all the files have the same type.

@indexzero
Copy link
Collaborator

The problem with this implementation is that it doesn't support multiple values being passed to -H. We should support that option too.

@indexzero
Copy link
Collaborator

Closing. No follow-up from author.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants