Treat `*.example.com` in `NO_PROXY` like `.example.com`

RA
2d ago
+10-0

Summary

A NO_PROXY entry such as *.example.com never matches. get_environment_proxies() prepends * to plain hostnames, which turns the entry into all://**.example.com, and URLPattern compiles that to ^(.+\.)?\*\.example\.com$. Requests to www.example.com still go through the proxy.

This change maps a leading *. to the same mount key as a leading . (all://*.example.com), so the entry matches subdomains of example.com. Go's net/http handles *. the same way.

Checklist

  • I understand that this PR may be closed in case there was no previous discussion. (This doesn't apply to typos!)
  • I've added a test for each change that was introduced, and I tried as much as possible to make a single atomic change.
  • I've updated the documentation accordingly.

Fixes #1276