Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions bin/http-server
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ if (argv.h || argv.help) {
' -p --port Port to use. If 0, look for open port. [8080]',
' -a Address to use [0.0.0.0]',
' -d Show directory listings [true]',
' -H --headers add response headers e.g.: --headers=Cross-Origin-Opener-Policy:same-origin',
' -i Display autoIndex [true]',
' -g --gzip Serve gzip files when possible [false]',
' -b --brotli Serve brotli files when possible [false]',
Expand Down Expand Up @@ -138,6 +139,7 @@ else {

function listen(port) {
var options = {
H: argv.headers || argv.header || argv.H,
root: argv._[0],
cache: argv.c,
timeout: argv.t,
Expand Down
1 change: 1 addition & 0 deletions lib/http-server.js
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,7 @@ function HttpServer(options) {
}

before.push(httpServerCore({
H: options.H,
root: this.root,
cache: this.cache,
showDir: this.showDir,
Expand Down