# isInNet arguments in the wrong order

Source: https://findproxyforurl.net/rules/isinnet-parameter-order/ · last updated 2026-10-04

Rule PAC-C016 (`isinnet-parameter-order`), severity high, category: Correctness.

isInNet(host, network, mask) is the order. isInNet("10.0.0.0", host, "255.0.0.0") compares the network literal against a mask derived from the hostname and is false for every request.

## Why it matters

With the network literal in the first position and `host` in the second, the function tries
to resolve `10.0.0.0` (fine, it is already an address) and to interpret the hostname as a
network address, which fails. The result is always false and the internal-network exception
never applies. The call looks plausible enough that reviewers miss it.


## How to fix

Write isInNet(host, "10.0.0.0", "255.0.0.0").

## Bad

```js
function FindProxyForURL(url, host) {
  if (isInNet("10.0.0.0", host, "255.0.0.0")) {
    return "DIRECT";
  }
  return "PROXY proxy.corp.example:8080";
}
```

## Good

```js
function FindProxyForURL(url, host) {
  if (isInNet(host, "10.0.0.0", "255.0.0.0")) {
    return "DIRECT";
  }
  return "PROXY proxy.corp.example:8080";
}
```
