@hom3chuk/tektek
Version:
A library for detecting technologies used within HTTP Archive (HAR)
33 lines (32 loc) • 928 B
JavaScript
import { rootHeaderContains, rootHeaderExists } from "../../common/index.js";
var detectDrupal = function (har, asap) {
if (asap === void 0) { asap = true; }
var res = {
detected: false,
name: 'Drupal',
reasons: [],
};
if (rootHeaderContains(har, 'x-generator', 'drupal')) {
res.detected = true;
res.reasons.push('x-generator header mentions drupal');
if (asap) {
return res;
}
}
if (rootHeaderExists(har, 'x-drupal-cache')) {
res.detected = true;
res.reasons.push('x-drupal-cache header exists');
if (asap) {
return res;
}
}
if (rootHeaderExists(har, 'x-drupal-dynamic-cache')) {
res.detected = true;
res.reasons.push('x-drupal-dynamic-cache header exists');
if (asap) {
return res;
}
}
return res;
};
export default detectDrupal;