@hom3chuk/tektek
Version:
A library for detecting technologies used within HTTP Archive (HAR)
35 lines (34 loc) • 1.03 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
var index_js_1 = require("../../common/index.js");
var detectDrupal = function (har, asap) {
if (asap === void 0) { asap = true; }
var res = {
detected: false,
name: 'Drupal',
reasons: [],
};
if ((0, index_js_1.rootHeaderContains)(har, 'x-generator', 'drupal')) {
res.detected = true;
res.reasons.push('x-generator header mentions drupal');
if (asap) {
return res;
}
}
if ((0, index_js_1.rootHeaderExists)(har, 'x-drupal-cache')) {
res.detected = true;
res.reasons.push('x-drupal-cache header exists');
if (asap) {
return res;
}
}
if ((0, index_js_1.rootHeaderExists)(har, 'x-drupal-dynamic-cache')) {
res.detected = true;
res.reasons.push('x-drupal-dynamic-cache header exists');
if (asap) {
return res;
}
}
return res;
};
exports.default = detectDrupal;