Skip to content

Commit f9b2786

Browse files
committed
Bypass cache authorization header
1 parent 22f36a2 commit f9b2786

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

common-caching.js

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,9 @@ function requestIsCachable(request) {
6161
if (hasPrivateCookie(request)) {
6262
return false;
6363
}
64+
if (hasAuthorizationHeader(request)) {
65+
return false;
66+
}
6467
return true;
6568
}
6669

@@ -75,6 +78,10 @@ function hasPrivateCookie(request) {
7578
);
7679
}
7780

81+
function hasAuthorizationHeader(request) {
82+
return request.headers.has("Authorization");
83+
}
84+
7885
function responseIsCachable(response) {
7986
if (!CACHABLE_HTTP_STATUS_CODES.includes(response.statusCode)) {
8087
return false;

0 commit comments

Comments
 (0)