Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
function getPagesFromHar(harJson, options) {
return pagexray.convert(harJson, {
includeAssets: true,
firstParty: options.firstParty
});
}
break;
}
case 'webpagetest.har':
case 'browsertime.har': {
if (
this.usingBrowsertime ||
(!this.usingBrowsertime && this.usingWebpagetest)
) {
const group = message.group;
let config = {
includeAssets: true,
firstParty: this.options.firstParty
? this.options.firstParty
: undefined
};
const pageSummary = pagexray.convert(message.data, config);
//check and print any http server error > 399
for (let summary of pageSummary) {
if (Object.keys(summary.responseCodes).some(code => code > 399)) {
for (let asset of summary.assets) {
if (asset.status > 399) {
log.info(
`The server responded with a ${
asset.status
} status code for ${h.short(asset.url, 60)}`
);
}
}
}
}
pagexrayAggregator.addToAggregate(pageSummary, group);