Default route has no comment
info
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.
Examples
Bad
function FindProxyForURL(url, host) {
if (isPlainHostName(host)) {
return "DIRECT";
}
return "PROXY proxy.corp.example:8080";
}
Open bad example in checkerGood
function FindProxyForURL(url, host) {
if (isPlainHostName(host)) {
return "DIRECT";
}
// default: everything else goes through the corporate proxy
return "PROXY proxy.corp.example:8080";
}
Open good example in checker