We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 5efafbc commit 535f61aCopy full SHA for 535f61a
lib/util/http.js
@@ -119,9 +119,9 @@ const url = (strings, ...parts) => {
119
120
// Checks Etag in the request if it matches serverEtag then returns 304
121
// Otherwise executes given function 'fn'
122
-const withEtag = (serverEtag, fn) => (request, response) => {
+const withEtag = (serverEtag, fn, isWeak=false) => (request, response) => {
123
124
- response.set('ETag', `"${serverEtag}"`);
+ response.set('ETag', `${isWeak ? 'W/': ''}"${serverEtag}"`);
125
126
// Etag logic inspired from https://stackoverflow.com/questions/72334843/custom-computed-etag-for-express-js/72335674#72335674
127
const clientEtag = request.get('If-None-Match');
0 commit comments