mirror of
https://github.com/electron/electron.git
synced 2026-01-08 23:18:06 -05:00
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:
@@ -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)) {
|
||||
|
||||
Reference in New Issue
Block a user