UNPKG

@aikidosec/firewall

Version:

Zen by Aikido is an embedded Application Firewall that autonomously protects Node.js apps against common and critical attacks, provides rate limiting, detects malicious traffic (including bots), and more.

17 lines (16 loc) 433 B
"use strict"; 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; } }