UNPKG

@hom3chuk/tektek

Version:

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

49 lines (48 loc) 1.47 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var index_js_1 = require("../../common/index.js"); var detectHAProxy = function (har, asap) { if (asap === void 0) { asap = true; } var res = { detected: false, name: 'HAProxy', reasons: [], }; if ((0, index_js_1.anyResourceHeaderExists)(har, 'x-haproxy')) { res.detected = true; res.reasons.push('x-haproxy header exists'); if (asap) { return res; } } if ((0, index_js_1.anyResourceHeaderContains)(har, 'x-proxy', 'haproxy')) { res.detected = true; res.reasons.push('x-proxy header mentions haproxy'); if (asap) { return res; } } if ((0, index_js_1.anyResourceHeaderExists)(har, 'x-haproxy-info')) { res.detected = true; res.reasons.push('x-haproxy-info header exists'); if (asap) { return res; } } if ((0, index_js_1.anyResourceHeaderExists)(har, 'x-haproxy-server')) { res.detected = true; res.reasons.push('x-haproxy-server header exists'); if (asap) { return res; } } if ((0, index_js_1.anyResourceAnyHeadersContain)(har, 'haproxy-external')) { res.detected = true; res.reasons.push('aproxy-external mentioned'); if (asap) { return res; } } return res; }; exports.default = detectHAProxy;