Browse Source

allow port param to be undefined

develop
ray-1337 2 years ago
parent
commit
6818ddcbc6
No known key found for this signature in database GPG Key ID: DED41DCC150FCD32
  1. 2
      src/methods/Allow.ts
  2. 2
      src/methods/Deny.ts

2
src/methods/Allow.ts

@ -20,7 +20,7 @@ async function port(port: number, protocol?: PortProtocol) {
/**
* Allow incoming requests through specific (IP) address. (root/sudo access is mandatory)
*/
async function address(address: string, port: number, protocol?: PortProtocol) {
async function address(address: string, port?: number, protocol?: PortProtocol) {
try {
// address validation
let checkAddress = checkAppropriateIP(address);

2
src/methods/Deny.ts

@ -20,7 +20,7 @@ async function port(port: number, protocol?: PortProtocol) {
/**
* Deny incoming requests through specific (IP) address. (root/sudo access is mandatory)
*/
async function address(address: string, port: number, protocol?: PortProtocol) {
async function address(address: string, port?: number, protocol?: PortProtocol) {
try {
// address validation
let checkAddress = checkAppropriateIP(address);

Loading…
Cancel
Save