mirror of
https://github.com/AikidoSec/safe-chain.git
synced 2026-05-26 12:10:49 +00:00
Initial
This commit is contained in:
parent
2676170b61
commit
4564b7f607
19 changed files with 1057 additions and 28 deletions
|
|
@ -15,3 +15,19 @@ export function getHeaderValueAsString(headers, headerName) {
|
|||
|
||||
return header;
|
||||
}
|
||||
|
||||
/**
|
||||
* Remove headers that become stale when the response body is modified.
|
||||
* @param {NodeJS.Dict<string | string[]> | undefined} headers
|
||||
* @returns {void}
|
||||
*/
|
||||
export function clearCachingHeaders(headers) {
|
||||
if (!headers) {
|
||||
return;
|
||||
}
|
||||
|
||||
delete headers["etag"];
|
||||
delete headers["last-modified"];
|
||||
delete headers["cache-control"];
|
||||
delete headers["content-length"];
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue