Fixing code review issues: adding some test cases for partition/session options.
This commit is contained in:
parent
b44d5290e2
commit
bdb3f4d4cb
4 changed files with 91 additions and 17 deletions
|
@ -5,7 +5,7 @@ const {EventEmitter} = require('events')
|
|||
const util = require('util')
|
||||
const {Readable} = require('stream')
|
||||
const {app} = require('electron')
|
||||
const {session} = require('electron')
|
||||
const {Session} = process.atomBinding('session')
|
||||
const {net, Net} = process.atomBinding('net')
|
||||
const {URLRequest} = net
|
||||
|
||||
|
@ -161,7 +161,7 @@ class ClientRequest extends EventEmitter {
|
|||
url: urlStr
|
||||
}
|
||||
if (options.session) {
|
||||
if (options.session instanceof session.Session) {
|
||||
if (options.session instanceof Session) {
|
||||
urlRequestOptions.session = options.session
|
||||
} else {
|
||||
throw new TypeError('`session` should be an instance of the Session class.')
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue