http-server icon indicating copy to clipboard operation
http-server copied to clipboard

Added option for custom headers

Open kipcode66 opened this issue 1 year ago • 4 comments

This PR adds an option to provide custom headers.

Relevant issues

Resolves #884

Contributor checklist
  • [ ] Provide tests for the changes (unless documentation-only)
  • [X] Documented any new features, CLI switches, etc. (if applicable)
    • [X] Server --help output
    • [X] README.md
    • [X] doc/http-server.1 (use the same format as other entries)
  • [X] The pull request is being made against the master branch
Maintainer checklist
  • [ ] Assign a version triage tag
  • [ ] Approve tests if applicable

kipcode66 avatar Aug 10 '24 04:08 kipcode66

I was coming back to make tests for this PR and fix the fact it doesn't handle colons in the header values, but I saw there was an other PR https://github.com/http-party/http-server/pull/887 which uses the curl approach to adding headers. Which approach would be prefered? should I just close this one if we'd rather use the curl-based one?

kipcode66 avatar Sep 23 '24 22:09 kipcode66

I was coming back to make tests for this PR and fix the fact it doesn't handle colons in the header values, but I saw there was an other PR #887 which uses the curl approach to adding headers. Which approach would be prefered? should I just close this one if we'd rather use the curl-based one?

Thanks for bringing the dupe to my attention. I like the idea of using known conventions where possible. Let's move focus to #887, and I've also opened discussion #899 so we can talk about superset syntax (i.e. maybe we allow semicolon-separated values as well if it doesn't conflict with curl's convention, because that seems more convenient to me).

KernelDeimos avatar Oct 07 '24 17:10 KernelDeimos