Skip to content

Commit bdfde5c

Browse files
authored
fix(firefox): roll firefox for postdata fix (#3196)
1 parent fab5eba commit bdfde5c

File tree

3 files changed

+15
-12
lines changed

3 files changed

+15
-12
lines changed

browsers.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
},
99
{
1010
"name": "firefox",
11-
"revision": "1140",
11+
"revision": "1144",
1212
"download": true
1313
},
1414
{

test/interception.jest.js

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -442,7 +442,7 @@ describe('Page.route', function() {
442442
method: 'POST',
443443
headers: { 'Content-Type': 'application/json' },
444444
mode: 'cors',
445-
body: JSON.stringify({ 'number': 1 })
445+
body: JSON.stringify({ 'number': 1 })
446446
});
447447
return response.json();
448448
});
@@ -466,11 +466,11 @@ describe('Page.route', function() {
466466
method: 'POST',
467467
headers: { 'Content-Type': 'application/json' },
468468
mode: 'cors',
469-
body: JSON.stringify({ 'number': 1 })
469+
body: JSON.stringify({ 'number': 1 })
470470
});
471471
return response.json();
472472
});
473-
expect(resp).toEqual(['POST', 'electric', 'gas']);
473+
expect(resp).toEqual(['POST', 'electric', 'gas']);
474474
}
475475
// Then DELETE
476476
{
@@ -479,11 +479,11 @@ describe('Page.route', function() {
479479
method: 'DELETE',
480480
headers: {},
481481
mode: 'cors',
482-
body: ''
482+
body: ''
483483
});
484484
return response.json();
485485
});
486-
expect(resp).toEqual(['DELETE', 'electric', 'gas']);
486+
expect(resp).toEqual(['DELETE', 'electric', 'gas']);
487487
}
488488
});
489489
});
@@ -534,7 +534,7 @@ describe('Request.continue', function() {
534534
]);
535535
expect((await serverRequest.postBody).toString('utf8')).toBe('doggo');
536536
});
537-
it.fail(FFOX)('should amend utf8 post data', async({page, server}) => {
537+
it('should amend utf8 post data', async({page, server}) => {
538538
await page.goto(server.EMPTY_PAGE);
539539
await page.route('**/*', route => {
540540
route.continue({ postData: 'пушкин' });
@@ -543,9 +543,10 @@ describe('Request.continue', function() {
543543
server.waitForRequest('/sleep.zzz'),
544544
page.evaluate(() => fetch('/sleep.zzz', { method: 'POST', body: 'birdy' }))
545545
]);
546+
expect(serverRequest.method).toBe('POST');
546547
expect((await serverRequest.postBody).toString('utf8')).toBe('пушкин');
547548
});
548-
it.fail(FFOX)('should amend longer post data', async({page, server}) => {
549+
it('should amend longer post data', async({page, server}) => {
549550
await page.goto(server.EMPTY_PAGE);
550551
await page.route('**/*', route => {
551552
route.continue({ postData: 'doggo-is-longer-than-birdy' });
@@ -554,9 +555,10 @@ describe('Request.continue', function() {
554555
server.waitForRequest('/sleep.zzz'),
555556
page.evaluate(() => fetch('/sleep.zzz', { method: 'POST', body: 'birdy' }))
556557
]);
558+
expect(serverRequest.method).toBe('POST');
557559
expect((await serverRequest.postBody).toString('utf8')).toBe('doggo-is-longer-than-birdy');
558560
});
559-
it.fail(FFOX)('should amend binary post data', async({page, server}) => {
561+
it('should amend binary post data', async({page, server}) => {
560562
await page.goto(server.EMPTY_PAGE);
561563
const arr = Array.from(Array(256).keys());
562564
await page.route('**/*', route => {
@@ -566,6 +568,7 @@ describe('Request.continue', function() {
566568
server.waitForRequest('/sleep.zzz'),
567569
page.evaluate(() => fetch('/sleep.zzz', { method: 'POST', body: 'birdy' }))
568570
]);
571+
expect(serverRequest.method).toBe('POST');
569572
const buffer = await serverRequest.postBody;
570573
expect(buffer.length).toBe(arr.length);
571574
for (let i = 0; i < arr.length; ++i)

utils/testserver/index.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -183,8 +183,8 @@ class TestServer {
183183
}
184184

185185
/**
186-
* @param {http.IncomingMessage} request
187-
* @param {http.ServerResponse} response
186+
* @param {http.IncomingMessage} request
187+
* @param {http.ServerResponse} response
188188
*/
189189
_onRequest(request, response) {
190190
request.on('error', error => {
@@ -199,7 +199,7 @@ class TestServer {
199199
request.on('end', () => resolve(body));
200200
});
201201
const pathName = url.parse(request.url).path;
202-
this.debugServer(`request ${pathName}`);
202+
this.debugServer(`request ${request.method} ${pathName}`);
203203
if (this._auths.has(pathName)) {
204204
const auth = this._auths.get(pathName);
205205
const credentials = Buffer.from((request.headers.authorization || '').split(' ')[1] || '', 'base64').toString();

0 commit comments

Comments
 (0)