@aikidosec/firewall
Version:
Zen by Aikido is an embedded Web Application Firewall that autonomously protects Node.js apps against common and critical attacks
12 lines (11 loc) • 386 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.tryParseURLPath = tryParseURLPath;
const tryParseURL_1 = require("./tryParseURL");
function tryParseURLPath(url) {
const parsed = (0, tryParseURL_1.tryParseURL)(url.startsWith("/") ? `http://localhost${url}` : url);
if (!parsed) {
return undefined;
}
return parsed.pathname;
}