Repository navigation
feat: add session support to requests from utility process - #51279
Conversation
404e7d0 to
dd35b1e
Compare
ckerr
left a comment
There was a problem hiding this comment.
API LGTM
Windows CI failure looks unrelated to the PR:
Run actions/download-artifact@3e5f45b
Downloading single artifact
Error: Unable to download artifact(s): Artifact not found for name: siso-windows-amd64
Please ensure that your artifact is not expired and the artifact was uploaded using a compatible version of toolkit/upload-artifact.
For more information, visit the GitHub Artifacts FAQ: https://github.com/actions/toolkit/blob/main/packages/artifact/docs/faq.md
Add `session` and `partition` options to `utilityProcess.fork()` to allow utility processes to use a session-specific network context instead of the system network context. This enables HTTP caching, cookie isolation, and webRequest interception for utility process network requests. When `respondToAuthRequestsFromMainProcess` is true and a session is provided, HTTP 401/407 auth challenges now emit a `login` event on the UtilityProcess instance rather than on `app`. Without a session, auth challenges continue to emit on `app` for backward compatibility.
dd35b1e to
0b0300b
Compare
|
Release Notes Persisted
|
|
I was unable to backport this PR to "42-x-y" cleanly; |
|
I was unable to backport this PR to "41-x-y" cleanly; |
|
@deepak1556 has manually backported this PR to "42-x-y", please check out #51698 |
| std::string partition; | ||
| if (opts.Get("session", &session) && session) { | ||
| } else if (opts.Get("partition", &partition)) { | ||
| session = Session::FromPartition(args->isolate(), partition); | ||
| } |
There was a problem hiding this comment.
Was scrolling through the code while reviewing the backport request for #51698. An empty if is somewhat unusual syntax (but not necessarily incorrect). Just want to make sure this is intentional. :)
There was a problem hiding this comment.
Sort of :) , aligning with existing parsing
electron/shell/browser/api/electron_api_web_contents.cc
Lines 917 to 926 in f5eacfb
|
@VerteDinde has manually backported this PR to "41-x-y", please check out #53000 |
Description of Change
Refs microsoft/vscode#307216
Fixes #44727
Add
sessionandpartitionoptions toutilityProcess.fork()to allow utility processes to use a session-specific network context instead of the system network context. This enables HTTP caching, cookie isolation, and webRequest interception for utility process network requests.When
respondToAuthRequestsFromMainProcessis true and a session is provided, HTTP 401/407 auth challenges now emit aloginevent on the UtilityProcess instance rather than onapp. Without a session, auth challenges continue to emit onappfor backward compatibility.This in design should be treated similar to how we manage sessions and http related stuff for renderer process, where webContents is the backing store in the main process.
Release Notes
Notes: Added session support to net module requests from utility process