# Default route has no comment

Source: https://findproxyforurl.net/rules/undocumented-default-route/ · last updated 2026-10-04

Rule PAC-B004 (`undocumented-default-route`), severity info, category: Best practice and maintainability.

The final unconditional return is the most consequential line in the file; it decides every request no exception matched. A one-line comment stating the intended default ("everything else via the corporate proxy") documents the design and is one of the conditions for an A+ grade.

## Why it matters

Readers of a PAC need to know whether "default to proxy" or "default to DIRECT" was a
decision or an accident. A comment immediately above the final return answers that and
gives reviewers a reference point for every exception above it. It costs one line.


## How to fix

Add a comment above the final return, e.g. // default - all other traffic via the corporate proxy.

## Bad

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

## Good

```js
function FindProxyForURL(url, host) {
  if (isPlainHostName(host)) {
    return "DIRECT";
  }
  // default: everything else goes through the corporate proxy
  return "PROXY proxy.corp.example:8080";
}
```
