# URL pattern pinned to http:// only

Source: https://findproxyforurl.net/rules/scheme-pinned-url-pattern/ · last updated 2026-10-12

Rule PAC-C015 (`scheme-pinned-url-pattern`), severity info, category: Correctness.

A url pattern starting with "http://" does not match "https://". Most sites are https today; unless different routing for plain http is intended, the rule is probably outdated.

## Why it matters

Scheme-specific routing is legitimate (e.g. legacy intranet applications on plain http).
But many `http://` patterns were written when the site was http and silently stopped
matching when it moved to https. The check only asks the author to confirm the intent;
hostname decisions should be on `host`, which is scheme-independent (PAC-C001).

Covering both schemes with `*://www.corp.example/*` only helps while the part after the host
is `*`: for https addresses Chrome, Edge and Windows pass only `https://host:port/`, and
Firefox passes no path for http either (lab, 2026-10-12). A pattern such as
`*://www.corp.example/app/*` therefore matches only plain http, and never in Firefox.


## How to fix

Match on host if the scheme does not matter; otherwise cover both schemes ("*://www.corp.example/*") and comment why.

## Bad

```js
function FindProxyForURL(url, host) {
  if (shExpMatch(url, "http://www.corp.example/*")) {
    return "DIRECT";
  }
  return "PROXY proxy.corp.example:8080";
}
```

## Good

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