@aikidosec/firewall
Version:
Zen by Aikido is an embedded Web Application Firewall that autonomously protects Node.js apps against common and critical attacks
18 lines (17 loc) • 425 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.default = isUriString;
const tryParseURL_1 = require("../../../helpers/tryParseURL");
function isUriString(str) {
if (str.length > 2084) {
return false;
}
const url = (0, tryParseURL_1.tryParseURL)(str);
if (!url) {
return false;
}
if (!url.hostname) {
return false;
}
return true;
}