Skip to content

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
Member

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
Member

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