fix(deps): update dependency axios to v1 (#3202)

* fix(deps): update dependency axios to v1

* fix: deal with possibly undefined headers from axios

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: sct <ryan@sct.dev>
This commit is contained in:
renovate[bot]
2023-01-05 11:05:46 +09:00
committed by GitHub
parent 4e9be7a3f7
commit 421029ebab
3 changed files with 17 additions and 9 deletions

View File

@@ -192,9 +192,11 @@ class ImageProxy {
const buffer = Buffer.from(response.data, 'binary');
const extension = path.split('.').pop() ?? '';
const maxAge = Number(response.headers['cache-control'].split('=')[1]);
const maxAge = Number(
(response.headers['cache-control'] ?? '0').split('=')[1]
);
const expireAt = Date.now() + maxAge * 1000;
const etag = response.headers.etag.replace(/"/g, '');
const etag = (response.headers.etag ?? '').replace(/"/g, '');
await this.writeToCacheDir(
directory,