diff --git a/bin/serve.js b/bin/serve.js index 45e583f3..ed19ec8f 100755 --- a/bin/serve.js +++ b/bin/serve.js @@ -83,6 +83,8 @@ const getHelp = () => chalk` -n, --no-clipboard Do not copy the local address to the clipboard + --no-etag Send \`Last-Modified\` header instead of \`ETag\` + -S, --symlinks Resolve symlinks instead of showing 404 errors {bold ENDPOINTS} @@ -327,6 +329,9 @@ const loadConfig = async (cwd, entry, args) => { } } + // "ETag" headers are enabled by default unless `--no-etag` is provided + config.etag = !args['--no-etag']; + return config; }; @@ -343,6 +348,7 @@ const loadConfig = async (cwd, entry, args) => { '--config': String, '--no-clipboard': Boolean, '--no-compression': Boolean, + '--no-etag': Boolean, '--symlinks': Boolean, '-h': '--help', '-v': '--version', diff --git a/package.json b/package.json index 9f1d50ae..31fc488b 100644 --- a/package.json +++ b/package.json @@ -43,7 +43,7 @@ "chalk": "2.4.1", "clipboardy": "1.2.3", "compression": "1.7.3", - "serve-handler": "6.0.2", + "serve-handler": "6.1.0", "update-check": "1.5.2" } } diff --git a/yarn.lock b/yarn.lock index bfa73274..3123927e 100644 --- a/yarn.lock +++ b/yarn.lock @@ -977,10 +977,10 @@ semver@^5.5.0: resolved "https://registry.yarnpkg.com/semver/-/semver-5.7.0.tgz#790a7cf6fea5459bac96110b29b60412dc8ff96b" integrity sha512-Ya52jSX2u7QKghxeoFGpLwCtGlt7j0oY9DYb5apt9nPlJ42ID+ulTXESnt/qAQcoSERyZ5sl3LDIOw0nAn/5DA== -serve-handler@6.0.2: - version "6.0.2" - resolved "https://registry.yarnpkg.com/serve-handler/-/serve-handler-6.0.2.tgz#c5afbace1a4aa28645f26483d64725b45f285048" - integrity sha512-D1zgDpvx9Rgjip6rzY2QBjlZwfr/oiDSg66HipOWkEw1appHn7/mXdVRL6F8+bd1KD117Wch4+4x78OTXQVwDg== +serve-handler@6.1.0: + version "6.1.0" + resolved "https://registry.yarnpkg.com/serve-handler/-/serve-handler-6.1.0.tgz#f1606dc6ff8f9029a1ee042c11dfe7903a5cb92e" + integrity sha512-63N075Tn3PsFYcu0NVV7tb367UbiW3gnC+/50ohL4oqOhAG6bmbaWqiRcXQgbzqc0ALBjSAzg7VTfa0Qw4E3hA== dependencies: bytes "3.0.0" content-disposition "0.5.2"