File tree 2 files changed +14
-1
lines changed 2 files changed +14
-1
lines changed Original file line number Diff line number Diff line change 1
1
var matrixcs = require ( "./lib/matrix" ) ;
2
- matrixcs . request ( require ( "request" ) ) ;
2
+ const request = require ( 'browser-request' ) ;
3
+ const queryString = require ( 'qs' ) ;
4
+
5
+ matrixcs . request ( function ( opts , fn ) {
6
+ // We manually fix the query string for browser-request because
7
+ // it doesn't correctly handle cases like ?via=one&via=two. Instead
8
+ // we mimic `request`'s query string interface to make it all work
9
+ // as expected.
10
+ // browser-request will happily take the constructed string as the
11
+ // query string without trying to modify it further.
12
+ opts . qs = queryString . stringify ( opts . qs || { } , opts . qsStringifyOptions ) ;
13
+ return request ( opts , fn ) ;
14
+ } ) ;
3
15
4
16
// just *accessing* indexedDB throws an exception in firefox with
5
17
// indexeddb disabled.
Original file line number Diff line number Diff line change 59
59
"content-type" : " ^1.0.2" ,
60
60
"loglevel" : " 1.6.1" ,
61
61
"memfs" : " ^2.10.1" ,
62
+ "qs" : " ^6.5.2" ,
62
63
"request" : " ^2.88.0"
63
64
},
64
65
"devDependencies" : {
You can’t perform that action at this time.
0 commit comments