Skip to content

Commit

Permalink
Update serve-handler to v6.1.0 and enable etag option by default (#…
Browse files Browse the repository at this point in the history
…546)

* Update `serve-handler` to v6.1.0 and enable `etag` option by default

Introduces a `--no-etag` flag to opt-out of ETags.

* Move option

* Add `--no-etag` to help output
  • Loading branch information
TooTallNate authored Jul 10, 2019
1 parent 29be622 commit decbbb5
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 5 deletions.
6 changes: 6 additions & 0 deletions bin/serve.js
Original file line number Diff line number Diff line change
Expand Up @@ -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}
Expand Down Expand Up @@ -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;
};

Expand All @@ -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',
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
}
}
8 changes: 4 additions & 4 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down

0 comments on commit decbbb5

Please sign in to comment.