UNPKG

@hom3chuk/tektek

Version:

A library for detecting technologies used within HTTP Archive (HAR)

40 lines (39 loc) 1.2 kB
import { anyResourceUrlContains, rootHeaderContains } from "../../common/index.js"; var detectJoomla = function (har, asap) { if (asap === void 0) { asap = true; } var res = { detected: false, name: 'Joomla!', reasons: [], }; if (rootHeaderContains(har, 'x-content-encoded-by', 'joomla')) { res.detected = true; res.reasons.push('x-content-encoded-by header mentions joomla'); if (asap) { return res; } } if (rootHeaderContains(har, 'x-powered-by', 'joomla')) { res.detected = true; res.reasons.push('x-powered-by header mentions joomla'); if (asap) { return res; } } if (rootHeaderContains(har, 'x-content-powered-by', 'joomla')) { res.detected = true; res.reasons.push('x-content-powered-by header mentions joomla'); if (asap) { return res; } } if (anyResourceUrlContains(har, '/media/jui/js/')) { res.detected = true; res.reasons.push('resource url contains jui js url'); if (asap) { return res; } } return res; }; export default detectJoomla;