Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: do not cancel CORS preflight request on proxy auth. #29812

Conversation

trop[bot]
Copy link
Contributor

@trop trop bot commented Jun 21, 2021

Backport of #29266

See that PR for details.

Notes: Fixed CORS preflight request always being cancelled when connecting via proxy requiring authentication for apps that had registered WebRequest listeners.

* fix: do not cancel CORS preflight request on proxy auth.

If connecting via proxy, preflight request can receive 407
header response from proxy. This does not mean request
was finished even though it received headers (from proxy,
not the destination server), so prevent "completing"
and most importantly deleting it, which causes request
to be canceled in network layer. Just continue to monitor it
and await proper response from server. Also add circut breaker
to cancel request if proxy auth failed 3 times (for example
user keeps cancelling auth). This behavior happens only
when app registered WebRequest api listeners.

* Port chromium webrequest changes to electron code.

Move relevant parts of chromium WebRequestProxyingURLLoaderFactory from
https://chromium-review.googlesource.com/c/chromium/src/+/2011781
into electron ProxyingURLLoaderFactory.

* Update code to upstreamed version and remove retyr count failsafe.

Co-authored-by: Milan Burda <milan.burda@gmail.com>
@electron-cation electron-cation bot added the new-pr 🌱 PR opened in the last 24 hours label Jun 21, 2021
@trop trop bot added 14-x-y backport This is a backport PR semver/patch backwards-compatible bug fixes labels Jun 21, 2021
@electron-cation electron-cation bot removed the new-pr 🌱 PR opened in the last 24 hours label Jun 21, 2021
@zcbenz zcbenz force-pushed the trop/14-x-y-bp-fix-do-not-cancel-cors-preflight-request-on-proxy-auth--1624252035525 branch from 7cc1593 to b7efbff Compare June 21, 2021 06:50
@zcbenz zcbenz merged commit 19cbb03 into 14-x-y Jun 21, 2021
@zcbenz zcbenz deleted the trop/14-x-y-bp-fix-do-not-cancel-cors-preflight-request-on-proxy-auth--1624252035525 branch June 21, 2021 10:05
@release-clerk
Copy link

release-clerk bot commented Jun 21, 2021

Release Notes Persisted

Fixed CORS preflight request always being cancelled when connecting via proxy requiring authentication for apps that had registered WebRequest listeners.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
14-x-y backport This is a backport PR semver/patch backwards-compatible bug fixes
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants