@aikidosec/firewall
Version:
Zen by Aikido is an embedded Web Application Firewall that autonomously protects Node.js apps against common and critical attacks
17 lines (16 loc) • 433 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.getPortFromURL = getPortFromURL;
function getPortFromURL(url) {
if (url.port && Number.isInteger(parseInt(url.port, 10))) {
return parseInt(url.port, 10);
}
switch (url.protocol) {
case "https:":
return 443;
case "http:":
return 80;
default:
return undefined;
}
}