File tree Expand file tree Collapse file tree 2 files changed +5
-3
lines changed Expand file tree Collapse file tree 2 files changed +5
-3
lines changed Original file line number Diff line number Diff line change @@ -5,7 +5,6 @@ import isEmpty from "lodash/isEmpty";
5
5
import tildify from "tildify" ;
6
6
import { v4 } from "uuid" ;
7
7
import ws from "ws" ;
8
- import { XMLHttpRequest as NodeXMLHttpRequest } from "xmlhttprequest" ; // TODO use @aminya /xmlhttprequest
9
8
import { URL } from "url" ;
10
9
import { Kernel , Session , ServerConnection } from "@jupyterlab/services" ;
11
10
import Config from "./config" ;
@@ -198,7 +197,9 @@ export default class WSKernelPicker {
198
197
options . requestHeaders . Cookie = cookie ;
199
198
200
199
options . xhrFactory = ( ) => {
201
- const request = new NodeXMLHttpRequest ( ) ;
200
+ // we use xmlhttprequest because it allows disabling header protection
201
+ const { XMLHttpRequest } = require ( "xmlhttprequest" ) ; // TODO use @aminya /xmlhttprequest
202
+ const request = new XMLHttpRequest ( ) ;
202
203
// Disable protections against setting the Cookie header
203
204
request . setDisableHeaderCheck ( true ) ;
204
205
return request as XMLHttpRequest ; // TODO fix the types
Original file line number Diff line number Diff line change 159
159
"mobx-react" : false ,
160
160
"@nteract/plotly" : false ,
161
161
"refractor" : false ,
162
- "highlight.js" : false
162
+ "highlight.js" : false ,
163
+ "xmlhttprequest" : false
163
164
},
164
165
"isLibrary" : true
165
166
}
You can’t perform that action at this time.
0 commit comments