feat: [net] add "credentials" option to net.request (#25284)
* feat: [net] add "credentials" option to net.request * remove debugging log * add tests
This commit is contained in:
parent
8970c80520
commit
0e7d59dd79
5 changed files with 388 additions and 266 deletions
|
@ -2,6 +2,7 @@ import * as url from 'url';
|
|||
import { Readable, Writable } from 'stream';
|
||||
import { app } from 'electron/main';
|
||||
import type { ClientRequestConstructorOptions, UploadProgress } from 'electron/main';
|
||||
|
||||
const {
|
||||
isValidHeaderName,
|
||||
isValidHeaderValue,
|
||||
|
@ -243,7 +244,8 @@ function parseOptions (optionsIn: ClientRequestConstructorOptions | string): Nod
|
|||
redirectPolicy,
|
||||
extraHeaders: options.headers || {},
|
||||
body: null as any,
|
||||
useSessionCookies: options.useSessionCookies || false
|
||||
useSessionCookies: options.useSessionCookies,
|
||||
credentials: options.credentials
|
||||
};
|
||||
for (const [name, value] of Object.entries(urlLoaderOptions.extraHeaders!)) {
|
||||
if (!isValidHeaderName(name)) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue