Skip to content

Commit

Permalink
Updating etag middleware
Browse files Browse the repository at this point in the history
  • Loading branch information
avoidwork committed Jan 4, 2019
1 parent 9285493 commit f1aac88
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion lib/tenso.js
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,7 @@ class Tenso extends Base {
}

canETag (pathname, method, header) {
return this.config.etags.enabled && regex.getOnly.test(method) && (header !== void 0 ? this.etags.valid({"cache-control": header}) : true) && this.config.etags.invalid.filter(i => i.test(pathname)).length === 0;
return this.config.etags.enabled && method === "GET" && (header !== void 0 ? this.etags.valid({"cache-control": header}) : true) && this.config.etags.invalid.filter(i => i.test(pathname)).length === 0;
}

clf (req, res, headers) {
Expand Down
8 changes: 4 additions & 4 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "tenso",
"description": "Tensō is an HTTP/HTTP2 REST API framework",
"version": "10.0.21",
"version": "10.0.22",
"homepage": "http://avoidwork.github.io/tenso",
"author": "Jason Mulligan <[email protected]>",
"repository": {
Expand Down Expand Up @@ -40,7 +40,7 @@
"precise": "^1.1.0",
"retsu": "^3.0.2",
"tiny-coerce": "^1.1.1",
"tiny-etag": "^2.0.8",
"tiny-etag": "^2.0.9",
"tiny-eventsource": "^1.2.0",
"tiny-merge": "^1.0.0",
"tiny-uuid4": "^1.0.1",
Expand Down

0 comments on commit f1aac88

Please sign in to comment.