@lighthouse/common
Advanced tools
Comparing version 4.24.3-canary.1427 to 4.24.3
@@ -0,1 +1,13 @@ | ||
# 4.24.3 (Sun Jan 29 2023) | ||
#### 🐛 Bug Fix | ||
- ❗️ Hotfix - Absolute URL error fix [#113](https://github.com/Lighthouse-io/common/pull/113) ([@ChrisHurt](https://github.com/ChrisHurt)) | ||
#### Authors: 1 | ||
- Chris Hurt ([@ChrisHurt](https://github.com/ChrisHurt)) | ||
--- | ||
# 4.24.2 (Mon Jan 23 2023) | ||
@@ -2,0 +14,0 @@ |
@@ -19,2 +19,4 @@ "use strict"; | ||
var _constants = require("../../constants"); | ||
// NOTE use the native fetch if it's available in the browser, because the | ||
@@ -45,2 +47,5 @@ // ponyfill (which actually uses the github polyfill) does not support all the | ||
}; | ||
const { | ||
isHeader = false | ||
} = options; | ||
return fetch(url, fetchOptions).then(response => { | ||
@@ -79,3 +84,9 @@ const contentHeader = response.headers.get('content-length'); | ||
}).catch(error => { | ||
// NOTE: catch all error to log and then rethrow | ||
if (isHeader) { | ||
// NOTE: Replace failed headers with LH logo | ||
console.error('FetchImageHeaderError', error); | ||
return fetchImage(_constants.LIGHTHOUSE_LOGO_URL, defaultOptions); | ||
} // NOTE: catch all error to log and then rethrow | ||
console.error(error); | ||
@@ -82,0 +93,0 @@ throw error; |
@@ -25,3 +25,5 @@ "use strict"; | ||
return (0, _helpers.fetchImage)(logoUrl).then(image => _page => ({ | ||
return (0, _helpers.fetchImage)(logoUrl, { | ||
isHeader: true | ||
}).then(image => _page => ({ | ||
columns: [{ | ||
@@ -28,0 +30,0 @@ fit: [80, 30], |
@@ -21,3 +21,5 @@ "use strict"; | ||
}); | ||
return (0, _helpers.fetchImage)(logoUrl).then(image => ({ | ||
return (0, _helpers.fetchImage)(logoUrl, { | ||
isHeader: true | ||
}).then(image => ({ | ||
columns: [{ | ||
@@ -24,0 +26,0 @@ fit: [130, 30], |
@@ -10,3 +10,4 @@ import _defineProperty from "@babel/runtime/helpers/defineProperty"; | ||
import fetchPonyfill from 'fetch-ponyfill'; | ||
import Promise from 'bluebird'; // NOTE use the native fetch if it's available in the browser, because the | ||
import Promise from 'bluebird'; | ||
import { LIGHTHOUSE_LOGO_URL } from '../../constants'; // NOTE use the native fetch if it's available in the browser, because the | ||
// ponyfill (which actually uses the github polyfill) does not support all the | ||
@@ -37,2 +38,4 @@ // same options as native fetch | ||
var _options$isHeader = options.isHeader, | ||
isHeader = _options$isHeader === void 0 ? false : _options$isHeader; | ||
return fetch(url, fetchOptions).then(function (response) { | ||
@@ -72,3 +75,9 @@ var contentHeader = response.headers.get('content-length'); | ||
}).catch(function (error) { | ||
// NOTE: catch all error to log and then rethrow | ||
if (isHeader) { | ||
// NOTE: Replace failed headers with LH logo | ||
console.error('FetchImageHeaderError', error); | ||
return fetchImage(LIGHTHOUSE_LOGO_URL, defaultOptions); | ||
} // NOTE: catch all error to log and then rethrow | ||
console.error(error); | ||
@@ -75,0 +84,0 @@ throw error; |
@@ -16,3 +16,5 @@ import { fetchImage, getTimezoneDatetime } from '../../../helpers'; | ||
return fetchImage(logoUrl).then(function (image) { | ||
return fetchImage(logoUrl, { | ||
isHeader: true | ||
}).then(function (image) { | ||
return function (_page) { | ||
@@ -19,0 +21,0 @@ return { |
@@ -12,3 +12,5 @@ import { fetchImage, getTimezoneDatetime } from '../../../helpers'; | ||
}); | ||
return fetchImage(logoUrl).then(function (image) { | ||
return fetchImage(logoUrl, { | ||
isHeader: true | ||
}).then(function (image) { | ||
return { | ||
@@ -15,0 +17,0 @@ columns: [{ |
{ | ||
"name": "@lighthouse/common", | ||
"version": "4.24.3-canary.1427", | ||
"version": "4.24.3", | ||
"description": "", | ||
@@ -5,0 +5,0 @@ "main": "dist/index.js", |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
1238913
11923
1