Skip to content

fix(page): let on(:request) handlers abort requests behind an authenticated proxy - #654

Merged
route merged 3 commits into
mainfrom
fix/proxy-auth-request-abort
Oct 18, 2026
Merged

route merged 3 commits into
mainfrom
fix/proxy-auth-request-abort

Conversation

@route

@route route commented Oct 18, 2026

Copy link
Copy Markdown
Member

Fixes #332

With a proxy that needs credentials, Ferrum adds its own on(:request) { continue } handler when it creates the page. That handler runs before any user handler, blacklist or whitelist, and continues every request first. Their abort then fails silently with "Invalid state". Now the built-in handler continues a request only when it's the only :request subscriber.

This matches how interception works without a proxy: once you subscribe to on(:request), your callbacks have to continue or abort every request, or it stays paused until the page times out. The changelog notes this under Changed, and the network and proxy docs now explain it.

Also adds the missing require "logger" in Ferrum::Proxy. Without it, Ferrum::Proxy.start raised NameError outside the spec suite.

route added 3 commits October 18, 2026 18:13
…icated proxy

Ferrum's own proxy-auth handler continued every intercepted request before user handlers, blacklist or whitelist ran,
so their abort failed silently with "Invalid state". The handler now continues a request only when it's the sole
`:request` subscriber.

Fixes #332
@route
route force-pushed the fix/proxy-auth-request-abort branch from 4ec94b9 to 377a263 Compare October 18, 2026 15:13
@route
route merged commit a019241 into main Oct 18, 2026
7 checks passed
@route
route deleted the fix/proxy-auth-request-abort branch October 18, 2026 15:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Proxied requests cannot be aborted

1 participant