Skip to content
This repository has been archived by the owner on Nov 7, 2022. It is now read-only.

Commit

Permalink
perf: skip parsing If-None-Match when no ETag header
Browse files Browse the repository at this point in the history
  • Loading branch information
dougwilson committed Feb 19, 2017
1 parent 2f11ec8 commit ec0e57b
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
1 change: 1 addition & 0 deletions HISTORY.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ unreleased

* Fix incorrect result when `If-None-Match` has both `*` and ETags
* Fix weak `ETag` matching to match spec
* perf: skip parsing `If-None-Match` when no `ETag` header

0.4.0 / 2017-02-05
==================
Expand Down
3 changes: 1 addition & 2 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -63,8 +63,7 @@ function fresh (reqHeaders, resHeaders) {

// if-none-match
if (noneMatch && noneMatch !== '*') {
noneMatch = noneMatch.split(TOKEN_LIST_REGEXP)
etagMatches = noneMatch.some(function (match) {
etagMatches = Boolean(etag) && noneMatch.split(TOKEN_LIST_REGEXP).some(function (match) {
return match === etag || match === 'W/' + etag || 'W/' + match === etag
})
}
Expand Down

0 comments on commit ec0e57b

Please sign in to comment.