forked from netptop/siteproxy
-
Notifications
You must be signed in to change notification settings - Fork 0
/
siteproxylocal.test.js
487 lines (440 loc) · 20.8 KB
/
siteproxylocal.test.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
/**
* @jest-environment node
*/
const axios = require('axios');
let httpprefix = 'https'
let serverName = `siteproxylocal.now.sh`
let port = '443'
if (process.env.localFlag === 'true') {
httpprefix = 'http'
serverName = '127.0.0.1'
port = '8011'
}
test('search wikipedia, open it, then click link', async () => {
const url = `${httpprefix}://${serverName}:${port}/https/zh.wikipedia.org/wiki/%E6%B5%8B%E8%AF%95`
const response = await axios({
method: 'get',
url,
})
// console.log(`${JSON.stringify(response)}`)
// expect(sum(1, 2)).toBe(3);
expect(response.data.indexOf(`/https/zh.wikipedia.org/wiki/%E6%B5%8B%E8%AF%95`)).not.toBe(-1)
}, 30000);
test('mitbbs /news_wenzhang/ issue', async () => {
const url = `${httpprefix}://${serverName}:${port}/https/www.mitbbs.com/news/mitbbs_news.php`
const response = await axios({
method: 'get',
url,
})
// console.log(`${response.data}`)
expect(response.data.indexOf(`href="/news_wenzhang`)).toBe(-1)
}, 30000);
test('mitbbs img issue', async () => {
const url = `${httpprefix}://${serverName}:${port}/https/www.mitbbs.com/news/mitbbs_news.php`
const response = await axios({
method: 'get',
url,
})
// console.log(`${response.data}`)
expect(response.data.indexOf(`img src="/https/www.mitbbs.com/img/list.png`)).not.toBe(-1)
}, 30000);
test('mitbbs home page img src issue', async () => {
const url = `${httpprefix}://${serverName}:${port}/https/www.mitbbs.com/`
const response = await axios({
method: 'get',
url,
})
expect(response.data.indexOf(`img src="../img`)).toBe(-1)
}, 30000);
test('google next click issue', async () => {
const url = `${httpprefix}://${serverName}:${port}/https/www.google.com/search?q=%E6%B5%B7%E5%A4%96%E8%AE%BA%E5%9D%9B&oq=%E6%B5%B7%E5%A4%96%E8%AE%BA%E5%9D%9B`
const response = await axios({
method: 'get',
url,
})
// console.log(`${response.data}`)
expect(response.data.indexOf(`href="/search?q=`)).toBe(-1)
}, 30000);
test('reuters.com /article issue', async () => {
const url = `${httpprefix}://${serverName}:${port}/https/cn.reuters.com/`
const response = await axios({
method: 'get',
url,
})
// console.log(`${response.data}`)
expect(response.data.indexOf(`"url":"/article`)).toBe(-1)
}, 30000);
test('worldjournal.com redirect location', async () => {
const url = `${httpprefix}://${serverName}:${port}/http/www.worldjournal.com`
const response = await axios({
method: 'get',
maxRedirects: 0,
validateStatus: null, // important for status 302
url,
})
// console.log(`${JSON.stringify(response.headers)}`)
expect(response.headers['location'].indexOf(`/https/www.worldjournal.com`)).not.toBe(-1)
}, 30000);
test('remove integrity', async () => {
const url = `${httpprefix}://${serverName}:${port}/https/github.com`
const response = await axios({
method: 'get',
headers: {
'Accept': `text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.9`,
},
url,
})
// console.log(`${JSON.stringify(response.headers)}`)
// console.log(`${response.data}`)
expect(response.data.indexOf(` integrity="`)).toBe(-1)
}, 30000);
test('yorkbbs issue', async () => {
const url = `${httpprefix}://${serverName}:${port}/http/www.yorkbbs.ca/`
const response = await axios({
method: 'get',
headers: {
'Accept': `text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.9`,
},
url,
})
// console.log(`${JSON.stringify(response.headers)}`)
// console.log(`${response.data}`)
expect(response.data.indexOf(`ca//http`)).toBe(-1)
}, 30000);
test('youtube response url encode issue', async () => {
const url = `${httpprefix}://${serverName}:${port}/https/www.youtube.com/get_video_info?html5=1&video_id=taVoseONjxc&cpn=DakN7Kk_Y_8rKsWf&eurl&el=embedded&hl=en_US&sts=18319&lact=30&c=WEB_EMBEDDED_PLAYER&cver=20200228&cplayer=UNIPLAYER&cbr=Chrome&cbrver=80.0.3987.87&cos=X11&autoplay=1&width=798&height=1048&ei=OgNcXrLJJMWItQeklqqgCw&iframe=1&embed_config=%7B%7D`
const response = await axios({
method: 'get',
headers: {
'Accept': `text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.9`,
},
url,
})
// console.log(`${JSON.stringify(response.headers)}`)
// console.log(`${response.data}`)
expect(response.data.indexOf(`vss_host`)).not.toBe(-1)
}, 30000);
test('youtube mobile url issue', async () => {
const url = `${httpprefix}://${serverName}:${port}/https/m.youtube.com/yts/jsbin/player-plasma-ias-phone-en_US-vflrryPzY/base.js`
const response = await axios({
method: 'get',
headers: {
'Accept': `text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.9`,
},
url,
})
// console.log(`${JSON.stringify(response.headers)}`)
// console.log(`${response.data}`)
// expect(response.data.indexOf(`"Captions URL"`)).toBe(-1)
expect(response.data.indexOf(`Untrusted URL:`)).toBe(-1)
}, 30000);
test('youtube url check issue', async () => {
const url = `${httpprefix}://${serverName}:${port}/https/www.youtube.com/s/player/64dddad9/player_ias.vflset/en_US/base.js`
const response = await axios({
method: 'get',
headers: {
'Accept': `text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.9`,
},
url,
})
// console.log(`${JSON.stringify(response.headers)}`)
// console.log(`${response.data}`)
// expect(response.data.indexOf(`"Captions URL"`)).toBe(-1)
expect(response.data.indexOf(`("//${serverName}:${port}/https/"+this.`)).not.toBe(-1)
expect(response.data.indexOf(`://i1.ytimg.com/vi`)).toBe(-1)
// expect(response.data.indexOf(`"ptracking"`)).toBe(-1)
expect(response.data.indexOf(`"/api/stats/"`)).toBe(-1)
expect(response.data.indexOf(`"://"+`)).toBe(-1)
expect(response.data.indexOf(`"://www.youtube.com/"`)).toBe(-1)
expect(response.data.indexOf(`a.A[c].style.display=0===b?"none":"";`)).toBe(-1)
}, 30000);
test('youtube desktop_polymer_v2.js issue', async () => {
const url = `${httpprefix}://${serverName}:${port}/https/www.youtube.com/yts/jsbin/desktop_polymer_v2-vflv5mvtW/desktop_polymer_v2.js`
const response = await axios({
method: 'get',
headers: {
'Accept': `text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.9`,
},
url,
})
// console.log(`${JSON.stringify(response.headers)}`)
// console.log(`${response.data}`)
expect(response.data.indexOf(`iconChanged_:function(a,b,c){},`)).not.toBe(-1)
expect(response.data.indexOf(`g+("/youtubei/"`)).toBe(-1)
expect(response.data.indexOf(`"/service_ajax"`)).toBe(-1)
expect(response.data.indexOf(`&&this.connectedCallback()):`)).toBe(-1)
expect(response.data.indexOf(`="/sw.js"`)).toBe(-1)
}, 30000);
test('/watch url conversion', async () => {
const url = `${httpprefix}://${serverName}:${port}/https/www.youtube.com/watch?v=ii1fTxhD_D0&spf=navigate`
const response = await axios({
method: 'get',
headers: {
'Accept': `text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.9`,
'Cookie': `VISITOR_INFO1_LIVE=WxtnB8UaTM4; YSC=QPym_D-ojR0`,
},
url,
})
// console.log(`${JSON.stringify(response.headers)}`)
// console.log(`${JSON.stringify(response.data)}`)
expect(JSON.stringify(response.data).indexOf(`/https/www.youtube.com/watch?v=`)).not.toBe(-1)
}, 30000);
test('youtube url conversion', async () => {
const url = `${httpprefix}://${serverName}:${port}/https/www.youtube.com/watch?v=I9K4MbvlDss&frags=pl%2Cwn`
const response = await axios({
method: 'get',
headers: {
'Accept': `text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.9`,
'Cookie': `VISITOR_INFO1_LIVE=WxtnB8UaTM4; YSC=QPym_D-ojR0`,
},
url,
})
// console.log(`${JSON.stringify(response.headers)}`)
// console.log(`${response.data}`)
expect(response.data.indexOf(`"\\/service_ajax\\",`)).toBe(-1)
}, 30000);
test('youtube homepage issue', async () => {
const url = `${httpprefix}://${serverName}:${port}/https/www.youtube.com/`
const response = await axios({
method: 'get',
headers: {
'Accept': `text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.9`,
'Cookie': 'GPS=1; YSC=GIEifM9pJtw; VISITOR_INFO1_LIVE=MV_eADDUWUs; IDE=AHWqTUkjx5qqT40ccfFUS2trOr4e16HYZavXZDtUZ8B_qBLODExo6SyQPAl-3Mbc',
},
url,
})
// console.log(`${JSON.stringify(response.headers)}`)
// console.log(`${response.data}`)
expect(response.data.indexOf(`"\\/service_ajax\\",`)).toBe(-1)
}, 8000); // should be done within 3 seconds.
// heroku headers:
// h==== req.url:/https/id.google.com/verify/ALoz5hxFM5vKCyL4RFaFnt6WR_AuQbx7abPPVMjTqOcXGhuzO-IkSXVdsRZsYnmhe8kQSMl9uvqudUdIQBA07Fg_guEQ7c0GP6qrAPVQrScGetd8fAZfMhk, req
// hheaders:{"host":"siteproxy.herokuapp.com","connection":"close","sec-fetch-dest":"image","dpr":"1","user-agent":"Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/80.0.3987.87 Safari/5
// h37.36","accept":"image/webp,image/apng,image/*,*/*;q=0.8","sec-fetch-site":"same-origin","sec-fetch-mode":"no-cors","referer":"https://siteproxy.herokuapp.com/","accept-encoding":"gzip, deflate, br","accept-lang
// huage":"en-US,en;q=0.9,zh-CN;q=0.8,zh;q=0.7","cookie":"NID=200=oRA6eiHr-AVq3TYpu1hAYlFFTt4FE3NTwVGhDTjs1L16VjJEuuyKW33tdEvz9ibbZNBplYLxm53p0O5AxgwyqCO1dzXie7NB_Mjq9B4AJyaZPMHKVaF0dqES1qtvyz7pRj5BqA6EKb7QB3FzLmj96
// hR4aggHdBTbu6yZWnZmvc10; 1P_JAR=2020-03-13-23","x-request-id":"d2e7fa06-ed41-4a49-b92d-7a5f87e5feb3","x-forwarded-for":"135.0.54.232","x-forwarded-proto":"https","x-forwarded-port":"443","via":"1.1 vegur","connec
// ht-time":"0","x-request-start":"1584141848398","total-route-time":"0"}
// h2020-03-13T23:24:08.403097+00:00 app[web.1]: httpType:https, host:id.google.com
test('doubi issue', async () => {
const url = `${httpprefix}://${serverName}:${port}/https/doubibackup.com`
const response = await axios({
method: 'get',
headers: {
'Accept': `text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.9`,
},
url,
})
// console.log(`${JSON.stringify(response.headers)}`)
// console.log(`${response.data}`)
expect(response.data.indexOf(`href="3x8ussyf.html"`)).toBe(-1)
expect(response.data.indexOf(` src="5ny9g1s2.gif" `)).toBe(-1)
}, 15000); // should be done within 3 seconds.
test('web.telegram.com href/src issues', async () => {
const url = `${httpprefix}://${serverName}:${port}/https/web.telegram.org`
const response = await axios({
method: 'get',
headers: {
'Accept': `text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.9`,
},
url,
})
// console.log(`${JSON.stringify(response.headers)}`)
// console.log(`${response.data}`)
expect(response.data.indexOf(`href=css/app.css`)).toBe(-1)
expect(response.data.indexOf(`src=js/app.js`)).toBe(-1)
}, 15000); // should be done within 3 seconds.
test('web.telegram.com href regular expression issue', async () => {
const url = `${httpprefix}://${serverName}:${port}/https/web.telegram.org/js/app.js`
const response = await axios({
method: 'get',
headers: {
'Accept': `text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.9`,
},
url,
})
// console.log(`${JSON.stringify(response.headers)}`)
// console.log(`${response.data}`)
expect(response.data.indexOf(`href=/https/web.telegram.org/e.value`)).toBe(-1)
}, 15000); // should be done within 3 seconds.
test('google search issue', async () => {
const url = `${httpprefix}://${serverName}:${port}/https/www.google.com/search?ei=pJ5yXtfwHOPP0PEPwaGzqAk&q=%E7%BB%B4%E5%9F%BA%E7%99%BE%E7%A7%91`
const response = await axios({
method: 'get',
headers: {
'Accept': `text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.9`,
},
url,
})
// console.log(`${JSON.stringify(response.headers)}`)
// console.log(`${response.data}`)
expect(response.data.indexOf(`/${httpprefix}://${serverName}:${port}/ht`)).toBe(-1)
}, 15000); // should be done within 3 seconds.
test('m.youtube.com search issue', async () => {
const url = `${httpprefix}://${serverName}:${port}/https/m.youtube.com/yts/jsbin/mobile-c3-vflPfniwW/mobile-c3.js`
const response = await axios({
method: 'get',
headers: {
'Accept': `text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.9`,
},
url,
})
// console.log(`${JSON.stringify(response.headers)}`)
//console.log(`${response.data}`)
expect(response.data.indexOf(`"/results?search_query="`)).toBe(-1)
}, 15000); // should be done within 3 seconds.
test('www.youtube.com search issue', async () => {
const url = `${httpprefix}://${serverName}:${port}/https/www.youtube.com/results?search_query=%E4%B8%AD%E5%9B%BD`
const response = await axios({
method: 'get',
headers: {
'Accept': `text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.9`,
},
url,
})
// console.log(`${JSON.stringify(response.headers)}`)
// console.log(`${response.data}`)
expect(response.data.indexOf(`"/results?search_query=`)).toBe(-1)
}, 15000); // should be done within 3 seconds.
// test('twitter pathname issue', async () => {
// const url = `${httpprefix}://${serverName}:${port}/https/abs.twimg.com/responsive-web/web/loader.Typeahead.3477b654.js`
// const response = await axios({
// method: 'get',
// headers: {
// 'Accept': `text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.9`,
// },
// url,
// })
// console.log(`${JSON.stringify(response.headers)}`)
// console.log(`${response.data}`)
// expect(response.data.indexOf(`pathname:"/"`)).toBe(-1)
//}, 15000); // should be done within 3 seconds.
test('youtube non-search-box issue', async () => {
const url = `${httpprefix}://${serverName}:${port}/https/m.youtube.com/yts/jsbin/mobile-c3-vflxm_8Y5/mobile-c3.js`
const response = await axios({
method: 'get',
headers: {
'Accept': `text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.9`,
},
url,
})
// console.log(`${JSON.stringify(response.headers)}`)
// console.log(`${response.data}`)
expect(response.data.indexOf(`non-search-box`)).toBe(-1)
}, 15000); // should be done within 3 seconds.
test('m.youtube.com show more on list page issue', async () => {
const url = `${httpprefix}://${serverName}:${port}/https/m.youtube.com/yts/jsbin/mobile-c3-vfl0qWxpM/mobile-c3.js`
const response = await axios({
method: 'get',
headers: {
'Accept': `text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.9`,
},
url,
})
// console.log(`${JSON.stringify(response.headers)}`)
// console.log(`${response.data}`)
expect(response.data.indexOf(`if(!a||(a.isMutedByMutedAutoplay&&a.isMutedByMutedAutoplay()))`)).not.toBe(-1)
}, 15000); // should be done within 3 seconds.
test('web.telegram.org login', async () => {
const url = `${httpprefix}://${serverName}:${port}/https/web.telegram.org/js/app.js`
const response = await axios({
method: 'get',
headers: {
'Accept': `text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.9`,
},
url,
})
// console.log(`${JSON.stringify(response.headers)}`)
//console.log(`${response.data}`)
// expect(response.data.indexOf(`pathname:"/"`)).toBe(-1)
expect(response.data.indexOf(`"venus"`)).toBe(-1)
}, 15000); // should be done within 3 seconds.
test('old youtube page', async () => {
const url = `${httpprefix}://${serverName}:${port}/https/m.youtube.com/watch?v=ayWJGSFgUZA&list=PLPVsJMpVPkCd_OUBs7Aj_dYEbwgO8ZtLY&index=2&t=0s&disable_polymer=true&itct=CCgQxjQYACITCIi9t_W8iOkCFcpCMAod2IYEwTIKcGxwcF92aWRlb1okVkxQTFBWc0pNcFZQa0NkX09VQnM3QWpfZFlFYndnTzhadExZ`
const response = await axios({
method: 'get',
headers: {
'Accept': `text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.9`,
},
url,
})
// console.log(`${JSON.stringify(response.headers)}`)
// console.log(`${response.data}`)
expect(response.data.indexOf(`"initcwndbps"`)).toBe(-1)
}, 15000); // should be done within 3 seconds.
test('youtube Url www.google.com issue', async () => {
const url = `${httpprefix}://${serverName}:${port}/https/www.youtube.com/watch?v=ayWJGSFgUZA&list=PLPVsJMpVPkCd_OUBs7Aj_dYEbwgO8ZtLY&index=2&t=0s&frags=pl%2Cwn`
const response = await axios({
method: 'get',
headers: {
'Accept': `text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.9`,
},
url,
})
// console.log(`${JSON.stringify(response.headers)}`)
//console.log(`${response.data}`)
expect(response.data.indexOf(`\"interpreterUrl\":\"\/\/www.google.com\/js\/bg\/jeQSBy52GP_vj-aLADK6D_RsHFfZXrt-vZElH-uv2ok.js\"`)).toBe(-1)
}, 15000); // should be done within 3 seconds.
test('youtube href fonts.googleapis.com issue', async () => {
const url = `${httpprefix}://${serverName}:${port}/https/www.youtube.com/watch?v=5HHRBe8bskE&list=PLPVsJMpVPkCd_OUBs7Aj_dYEbwgO8ZtLY&index=6&t=0s&frags=pl%2Cwn`
const response = await axios({
method: 'get',
headers: {
'Accept': `text/html,application/xhtml+xml,applino content-type fieldcation/xml;q=0.9,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.9`,
},
url,
})
// console.log(`${JSON.stringify(response.headers)}`)
// console.log(`${response.data}`)
expect(response.data.indexOf(`href="/https/www.youtube.com//127.0.0.1:8011/https/fonts.googleapis.com/css`)).toBe(-1)
}, 15000); // should be done within 3 seconds.
test('youtube watch address bar issue', async () => {
const url = `${httpprefix}://${serverName}:${port}/https/www.youtube.com/watch?v=tTzRY7F_1OU&spf=navigate`
const response = await axios({
method: 'get',
headers: {
'Accept': `text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.9`,
},
url,
})
// console.log(`${JSON.stringify(response.headers)}`)
// console.log(`${JSON.stringify(response.data)}`)
expect(JSON.stringify(response.data).indexOf(`{"url":"/watch?v=tTzRY7F_1OU"`)).toBe(-1)
}, 15000); // should be done within 3 seconds.
test('"https://" should be removed', async () => {
const url = `${httpprefix}://${serverName}:${port}/https/di.phncdn.com/www-static/js/ph-tracking.js?cache=2020051402`
const response = await axios({
method: 'get',
headers: {
'Accept': `text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.9`,
},
url,
})
// console.log(`${JSON.stringify(response.headers)}`)
// console.log(`${response.data}`)
expect((response.data).indexOf(`"https://"`)).toBe(-1)
}, 15000); // should be done within 3 seconds.
test('30.toString() should not be existed', async () => {
const url = `${httpprefix}://${serverName}:${port}/https/www.youtube.com/s/desktop/751ee0bc/htdocs-ytimg-desktop-kevlar-production/jsbin/desktop_polymer_inlined_html_polymer_flags_legacy_browsers_v2.vflset/desktop_polymer_inlined_html_polymer_flags_legacy_browsers_v2.js`
const response = await axios({
method: 'get',
headers: {
'Accept': `text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.9`,
},
url,
})
// console.log(`${JSON.stringify(response.headers)}`)
// console.log(`${response.data}`)
expect((response.data).indexOf(`30.toString()`)).toBe(-1)
}, 15000); // should be done within 3 seconds.
test('no exception for fonts.gstatic.com', async () => {
const url = `${httpprefix}://${serverName}:${port}/https/fonts.gstatic.com/s/roboto/v18/KFOmCnqEu92Fr1Mu4mxMKTU1Kg.woff`
const response = await axios({
method: 'get',
headers: {
},
url,
})
console.log(`${JSON.stringify(response.headers)}`)
// console.log(`${response.data}`)
// expect((response.data).indexOf(`30.toString()`)).toBe(-1)
}, 15000); // should be done within 3 seconds.