a failed proxy.onRequest should optionally prevent the request
Categories
(WebExtensions :: Request Handling, enhancement, P3)
Tracking
(Not tracked)
People
(Reporter: mixedpuppy, Unassigned)
References
Details
https://bugzilla.mozilla.org/show_bug.cgi?id=1528873#c6
caveat: "fallback to default proxy" can't always be assumed to be a safe default."
I agree, and perhaps we should address this. I'm unsure if we should address it in a manor where there is an error page that appears, though that isn't great for xhr/fetch. Should it be an option the user must set, or something via proxy.settings.
Reporter | ||
Updated•6 years ago
|
Comment 1•6 years ago
|
||
I'm kind of inclined to make the behavior configurable by the extension, perhaps as part of the onRequest API, or perhaps as part of proxy.settings. As the original poster mentioned, it is possible for a dev to do the right thing, but only if they are paying attention to this (perhaps unexpected) behavior.
It would be good to get some Necko opinions here.
Reporter | ||
Comment 2•6 years ago
|
||
:valentin this is related to bug 1528873 comment 6. How can we go about getting an opinion on what the correct behavior in handling the proxy response should be?
I put it on the roundtable for tomorrow's necko meeting. We'll discuss and I'll report back.
We mostly think it would be OK for this to be configurable by the extension.
I assume we would normally want to fail the request if there's some unexpected error, BUT it's important that this error is presented to the user, so they are aware why the request fail.
Also, is this applicable only when there's an exception in the webextension, or also when the proxy is not reachable?
Reporter | ||
Comment 5•6 years ago
|
||
(In reply to Valentin Gosu [:valentin] from comment #4)
We mostly think it would be OK for this to be configurable by the extension.
I assume we would normally want to fail the request if there's some unexpected error, BUT it's important that this error is presented to the user, so they are aware why the request fail.
Ok, that will take some thinking.
Also, is this applicable only when there's an exception in the webextension, or also when the proxy is not reachable?
It's only applicable when the extension throws an exception, or returns invalid data for proxyInfo. A proxy not being reachable should be handled by the proxy service/channel stuff.
Of note:
- There is no way to return a status from a proxy filter. [1]
- There is a comment in httpChannel about falling back to direct if there is an error. [2]
[1] https://searchfox.org/mozilla-central/rev/f1c7ba91fad60bfea184006f3728dd6ac48c8e56/netwerk/base/nsIProtocolProxyFilter.idl#32
[2] https://searchfox.org/mozilla-central/rev/f1c7ba91fad60bfea184006f3728dd6ac48c8e56/netwerk/protocol/http/nsHttpChannel.cpp#6876
Updated•3 years ago
|
Description
•