• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

Kikobeats / parse-proxy-uri / 31181760862
100%

Build:
DEFAULT BRANCH: master
Ran 07 Aug 2026 01:15PM UTC
Jobs 1
Files 1
Run time 1min
Badge
Embed ▾
README BADGES
x

If you need to use a raster PNG badge, change the '.svg' to '.png' in the link

Markdown

Textile

RDoc

HTML

Rst

07 Aug 2026 01:14PM UTC coverage: 100.0% (+1.3%) from 98.726%
31181760862

push

github

web-flow
fix: keep ProxyURL credential mutations decode-safe (#27)

* fix: keep ProxyURL credential mutations decode-safe

Node's URL userinfo setters leave bare `%` sequences intact, so assigning
a password like `100%pure` via `.password` or `.href` made `.auth` throw
URIError and `toString()` emit a URI that got-scraping cannot decode.

Encode invalid `%` on username/password assignment, and reject href
mutations that introduce undecodable or control-character credentials
while rolling back to the previous value.

Co-authored-by: kikohumanbeatbox <kikohumanbeatbox@gmail.com>

* fix: validate every ProxyURL mutation path

The constructor's invariants only ran at parse time, so any setter could walk
a parsed proxy back into a shape parseProxy would have rejected: `href` took
paths, queries, fragments, `data:` URIs and obfuscated IPv4 hosts; `hostname`
and `host` re-opened the IPv4 rewrite closed in #25; `pathname`/`search`/`hash`
and `searchParams` desynced `href` from `toString()`.

Every mutation now runs the full check and rolls back on rejection, and
failures throw ParseProxyError (now a TypeError) so `error.code` works the
same as it does for parseProxy.

Credential setters take raw values and encode them, replacing the hybrid rule
where a password containing `%40` was silently decoded to `@` and dialed
wrong. `username`, `password` and `href` are non-enumerable, matching
URL.prototype, so spreading or logging a proxy no longer leaks credentials.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01PUCXKwRQmtkcisF71E4MRj

* refactor: move ProxyURL accessors to the prototype

The guards were built per instance: 11 defineProperty calls and 13 closures
over the constructor scope for every parsed proxy, so each live proxy pinned
that scope. Defining them once on the prototype cuts parse from 2295 to 682
ns/op and 3351 to 262 bytes per live instance (200k iterations, 50k live
instances, --expose-g... (continued)

62 of 62 branches covered (100.0%)

Branch coverage included in aggregate %.

133 of 133 new or added lines in 1 file covered. (100.0%)

182 of 182 relevant lines covered (100.0%)

55.23 hits per line

Jobs
ID Job ID Ran Files Coverage
1 31181760862.1 07 Aug 2026 01:15PM UTC 1
100.0
GitHub Action Run
Source Files on build 31181760862
  • Tree
  • List 1
  • Changed 1
  • Source Changed 1
  • Coverage Changed 1
Coverage ∆ File Lines Relevant Covered Missed Hits/Line Branch Hits Branch Misses
  • Back to Repo
  • Github Actions Build #31181760862
  • 52391c47 on github
  • Prev Build on master (#31016687283)
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE TRIAL · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc