@@ -146,10 +146,16 @@ describe('middleware.proxy', () => {
146
146
host : 'localhost' ,
147
147
port : '8000' ,
148
148
baseUrl : '/' ,
149
- path : '/base/' ,
150
- https : false
149
+ path : '/base/'
151
150
} )
152
151
expect ( parsedProxyConfig [ 0 ] . proxy ) . to . exist
152
+ expect ( parsedProxyConfig [ 0 ] . proxy ) . to . containSubset ( {
153
+ options : {
154
+ target : {
155
+ protocol : 'http:'
156
+ }
157
+ }
158
+ } )
153
159
} )
154
160
155
161
it ( 'should set default http port' , ( ) => {
@@ -160,10 +166,16 @@ describe('middleware.proxy', () => {
160
166
host : 'localhost' ,
161
167
port : '80' ,
162
168
baseUrl : '/' ,
163
- path : '/base/' ,
164
- https : false
169
+ path : '/base/'
165
170
} )
166
171
expect ( parsedProxyConfig [ 0 ] . proxy ) . to . exist
172
+ expect ( parsedProxyConfig [ 0 ] . proxy ) . to . containSubset ( {
173
+ options : {
174
+ target : {
175
+ protocol : 'http:'
176
+ }
177
+ }
178
+ } )
167
179
} )
168
180
169
181
it ( 'should set default https port' , ( ) => {
@@ -174,8 +186,7 @@ describe('middleware.proxy', () => {
174
186
host : 'localhost' ,
175
187
port : '443' ,
176
188
baseUrl : '/' ,
177
- path : '/base/' ,
178
- https : true
189
+ path : '/base/'
179
190
} )
180
191
expect ( parsedProxyConfig [ 0 ] . proxy ) . to . exist
181
192
expect ( parsedProxyConfig [ 0 ] . proxy ) . to . containSubset ( {
@@ -195,10 +206,16 @@ describe('middleware.proxy', () => {
195
206
host : 'localhost' ,
196
207
port : '8000' ,
197
208
baseUrl : '/proxy' ,
198
- path : '/base' ,
199
- https : false
209
+ path : '/base'
200
210
} )
201
211
expect ( parsedProxyConfig [ 0 ] . proxy ) . to . exist
212
+ expect ( parsedProxyConfig [ 0 ] . proxy ) . to . containSubset ( {
213
+ options : {
214
+ target : {
215
+ protocol : 'http:'
216
+ }
217
+ }
218
+ } )
202
219
} )
203
220
204
221
it ( 'should determine protocol' , ( ) => {
@@ -209,8 +226,7 @@ describe('middleware.proxy', () => {
209
226
host : 'localhost' ,
210
227
port : '8000' ,
211
228
baseUrl : '' ,
212
- path : '/base' ,
213
- https : true
229
+ path : '/base'
214
230
} )
215
231
expect ( parsedProxyConfig [ 0 ] . proxy ) . to . exist
216
232
expect ( parsedProxyConfig [ 0 ] . proxy ) . to . containSubset ( {
@@ -231,8 +247,7 @@ describe('middleware.proxy', () => {
231
247
host : 'localhost' ,
232
248
port : 9877 ,
233
249
baseUrl : '/proxy/test' ,
234
- path : '/base' ,
235
- https : false
250
+ path : '/base'
236
251
} )
237
252
expect ( parsedProxyConfig [ 0 ] . proxy ) . to . exist
238
253
} )
@@ -246,8 +261,7 @@ describe('middleware.proxy', () => {
246
261
host : 'localhost' ,
247
262
port : 9877 ,
248
263
baseUrl : '/proxy/test/' ,
249
- path : '/base/' ,
250
- https : false
264
+ path : '/base/'
251
265
} )
252
266
expect ( parsedProxyConfig [ 0 ] . proxy ) . to . exist
253
267
} )
@@ -261,8 +275,7 @@ describe('middleware.proxy', () => {
261
275
host : 'krinkle.dev' ,
262
276
port : '80' ,
263
277
baseUrl : '/w' ,
264
- path : '/w' ,
265
- https : false
278
+ path : '/w'
266
279
} )
267
280
expect ( parsedProxyConfig [ 0 ] . proxy ) . to . exist
268
281
} )
@@ -276,8 +289,7 @@ describe('middleware.proxy', () => {
276
289
host : 'krinkle.dev' ,
277
290
port : '443' ,
278
291
baseUrl : '/w' ,
279
- path : '/w' ,
280
- https : true
292
+ path : '/w'
281
293
} )
282
294
expect ( parsedProxyConfig [ 0 ] . proxy ) . to . exist
283
295
} )
@@ -290,8 +302,7 @@ describe('middleware.proxy', () => {
290
302
host : 'localhost' ,
291
303
port : '8000' ,
292
304
baseUrl : '/proxy/test/' ,
293
- path : '/base/' ,
294
- https : false
305
+ path : '/base/'
295
306
} )
296
307
expect ( parsedProxyConfig [ 0 ] . proxy ) . to . exist
297
308
} )
@@ -307,16 +318,14 @@ describe('middleware.proxy', () => {
307
318
host : 'gstatic.com' ,
308
319
port : '80' ,
309
320
baseUrl : '/something' ,
310
- path : '/sub/some' ,
311
- https : false
321
+ path : '/sub/some'
312
322
} )
313
323
expect ( parsedProxyConfig [ 0 ] . proxy ) . to . exist
314
324
expect ( parsedProxyConfig [ 1 ] ) . to . containSubset ( {
315
325
host : 'localhost' ,
316
326
port : '9000' ,
317
327
baseUrl : '' ,
318
- path : '/sub' ,
319
- https : false
328
+ path : '/sub'
320
329
} )
321
330
expect ( parsedProxyConfig [ 1 ] . proxy ) . to . exist
322
331
} )
@@ -331,8 +340,7 @@ describe('middleware.proxy', () => {
331
340
host : 'localhost' ,
332
341
port : '8000' ,
333
342
baseUrl : '/' ,
334
- path : '/base/' ,
335
- https : false
343
+ path : '/base/'
336
344
} )
337
345
expect ( parsedProxyConfig [ 0 ] . proxy ) . to . exist
338
346
} )
0 commit comments