Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
41 changes: 32 additions & 9 deletions .github/actions/sign-attestations/dist/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -22856,12 +22856,13 @@ module.exports = class CachePolicy {

/**
* @param {{headers: Record<string, string>, synchronous: boolean}|undefined} revalidation - Revalidation information, if any.
* @returns {{response: {headers: Record<string, string>}, revalidation: {headers: Record<string, string>, synchronous: boolean}|undefined}} An object with a cached response headers and revalidation info.
* @returns {{response: HttpResponse, revalidation: {headers: Record<string, string>, synchronous: boolean}|undefined}} An object with a cached response headers and revalidation info.
*/
_evaluateRequestHitResult(revalidation) {
return {
response: {
headers: this.responseHeaders(),
status: this._status,
},
revalidation,
};
Expand Down Expand Up @@ -22909,9 +22910,9 @@ module.exports = class CachePolicy {
* }
* ```
* @param {HttpRequest} req - new incoming HTTP request
* @returns {{response: {headers: Record<string, string>}|undefined, revalidation: {headers: Record<string, string>, synchronous: boolean}|undefined}} An object containing keys:
* @returns {{response: HttpResponse|undefined, revalidation: {headers: Record<string, string>, synchronous: boolean}|undefined}} An object containing keys:
* - revalidation: { headers: Record<string, string>, synchronous: boolean } Set if you should send this to the origin server
* - response: { headers: Record<string, string> } Set if you can respond to the client with these cached headers
* - response: HttpResponse Set if you can respond to the client with these cached headers
*/
evaluateRequest(req) {
this._assertRequestHasHeaders(req);
Expand Down Expand Up @@ -23006,18 +23007,32 @@ module.exports = class CachePolicy {
return true;
}

// A Vary header field-value of "*" always fails to match
if (this._resHeaders.vary === '*') {
return false;
}

const fields = this._resHeaders.vary
.trim()
.toLowerCase()
.split(/\s*,\s*/);

for (const name of fields) {
if (req.headers[name] !== this._reqHeaders[name]) return false;
// A Vary header field-value of "*" always fails to match
if (name === '*') {
return false;
}

const newReq = Object.prototype.hasOwnProperty.call(
req.headers,
name
) && req.headers[name];

const cachedReq = Object.prototype.hasOwnProperty.call(
this._reqHeaders,
name
) && this._reqHeaders[name];

if (newReq !== cachedReq) {
return false;
}
}

return true;
}

Expand Down Expand Up @@ -23078,6 +23093,14 @@ module.exports = class CachePolicy {
return headers;
}

/**
* Returns the status code of the cached response.
* @returns {number} The response status code.
*/
status() {
return this._status;
}

/**
* Returns the Date header value from the response or the current time if invalid.
* @returns {number} Timestamp (in milliseconds) representing the Date header or response time.
Expand Down
2 changes: 1 addition & 1 deletion .github/actions/sign-attestations/dist/index.js.map

Large diffs are not rendered by default.

6 changes: 3 additions & 3 deletions .github/actions/sign-attestations/package-lock.json

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

Loading