fix(firefox): roll firefox for postdata fix (#3196)
This commit is contained in:
parent
fab5eba64f
commit
bdfde5cd5c
|
|
@ -8,7 +8,7 @@
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "firefox",
|
"name": "firefox",
|
||||||
"revision": "1140",
|
"revision": "1144",
|
||||||
"download": true
|
"download": true
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -442,7 +442,7 @@ describe('Page.route', function() {
|
||||||
method: 'POST',
|
method: 'POST',
|
||||||
headers: { 'Content-Type': 'application/json' },
|
headers: { 'Content-Type': 'application/json' },
|
||||||
mode: 'cors',
|
mode: 'cors',
|
||||||
body: JSON.stringify({ 'number': 1 })
|
body: JSON.stringify({ 'number': 1 })
|
||||||
});
|
});
|
||||||
return response.json();
|
return response.json();
|
||||||
});
|
});
|
||||||
|
|
@ -466,11 +466,11 @@ describe('Page.route', function() {
|
||||||
method: 'POST',
|
method: 'POST',
|
||||||
headers: { 'Content-Type': 'application/json' },
|
headers: { 'Content-Type': 'application/json' },
|
||||||
mode: 'cors',
|
mode: 'cors',
|
||||||
body: JSON.stringify({ 'number': 1 })
|
body: JSON.stringify({ 'number': 1 })
|
||||||
});
|
});
|
||||||
return response.json();
|
return response.json();
|
||||||
});
|
});
|
||||||
expect(resp).toEqual(['POST', 'electric', 'gas']);
|
expect(resp).toEqual(['POST', 'electric', 'gas']);
|
||||||
}
|
}
|
||||||
// Then DELETE
|
// Then DELETE
|
||||||
{
|
{
|
||||||
|
|
@ -479,11 +479,11 @@ describe('Page.route', function() {
|
||||||
method: 'DELETE',
|
method: 'DELETE',
|
||||||
headers: {},
|
headers: {},
|
||||||
mode: 'cors',
|
mode: 'cors',
|
||||||
body: ''
|
body: ''
|
||||||
});
|
});
|
||||||
return response.json();
|
return response.json();
|
||||||
});
|
});
|
||||||
expect(resp).toEqual(['DELETE', 'electric', 'gas']);
|
expect(resp).toEqual(['DELETE', 'electric', 'gas']);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
@ -534,7 +534,7 @@ describe('Request.continue', function() {
|
||||||
]);
|
]);
|
||||||
expect((await serverRequest.postBody).toString('utf8')).toBe('doggo');
|
expect((await serverRequest.postBody).toString('utf8')).toBe('doggo');
|
||||||
});
|
});
|
||||||
it.fail(FFOX)('should amend utf8 post data', async({page, server}) => {
|
it('should amend utf8 post data', async({page, server}) => {
|
||||||
await page.goto(server.EMPTY_PAGE);
|
await page.goto(server.EMPTY_PAGE);
|
||||||
await page.route('**/*', route => {
|
await page.route('**/*', route => {
|
||||||
route.continue({ postData: 'пушкин' });
|
route.continue({ postData: 'пушкин' });
|
||||||
|
|
@ -543,9 +543,10 @@ describe('Request.continue', function() {
|
||||||
server.waitForRequest('/sleep.zzz'),
|
server.waitForRequest('/sleep.zzz'),
|
||||||
page.evaluate(() => fetch('/sleep.zzz', { method: 'POST', body: 'birdy' }))
|
page.evaluate(() => fetch('/sleep.zzz', { method: 'POST', body: 'birdy' }))
|
||||||
]);
|
]);
|
||||||
|
expect(serverRequest.method).toBe('POST');
|
||||||
expect((await serverRequest.postBody).toString('utf8')).toBe('пушкин');
|
expect((await serverRequest.postBody).toString('utf8')).toBe('пушкин');
|
||||||
});
|
});
|
||||||
it.fail(FFOX)('should amend longer post data', async({page, server}) => {
|
it('should amend longer post data', async({page, server}) => {
|
||||||
await page.goto(server.EMPTY_PAGE);
|
await page.goto(server.EMPTY_PAGE);
|
||||||
await page.route('**/*', route => {
|
await page.route('**/*', route => {
|
||||||
route.continue({ postData: 'doggo-is-longer-than-birdy' });
|
route.continue({ postData: 'doggo-is-longer-than-birdy' });
|
||||||
|
|
@ -554,9 +555,10 @@ describe('Request.continue', function() {
|
||||||
server.waitForRequest('/sleep.zzz'),
|
server.waitForRequest('/sleep.zzz'),
|
||||||
page.evaluate(() => fetch('/sleep.zzz', { method: 'POST', body: 'birdy' }))
|
page.evaluate(() => fetch('/sleep.zzz', { method: 'POST', body: 'birdy' }))
|
||||||
]);
|
]);
|
||||||
|
expect(serverRequest.method).toBe('POST');
|
||||||
expect((await serverRequest.postBody).toString('utf8')).toBe('doggo-is-longer-than-birdy');
|
expect((await serverRequest.postBody).toString('utf8')).toBe('doggo-is-longer-than-birdy');
|
||||||
});
|
});
|
||||||
it.fail(FFOX)('should amend binary post data', async({page, server}) => {
|
it('should amend binary post data', async({page, server}) => {
|
||||||
await page.goto(server.EMPTY_PAGE);
|
await page.goto(server.EMPTY_PAGE);
|
||||||
const arr = Array.from(Array(256).keys());
|
const arr = Array.from(Array(256).keys());
|
||||||
await page.route('**/*', route => {
|
await page.route('**/*', route => {
|
||||||
|
|
@ -566,6 +568,7 @@ describe('Request.continue', function() {
|
||||||
server.waitForRequest('/sleep.zzz'),
|
server.waitForRequest('/sleep.zzz'),
|
||||||
page.evaluate(() => fetch('/sleep.zzz', { method: 'POST', body: 'birdy' }))
|
page.evaluate(() => fetch('/sleep.zzz', { method: 'POST', body: 'birdy' }))
|
||||||
]);
|
]);
|
||||||
|
expect(serverRequest.method).toBe('POST');
|
||||||
const buffer = await serverRequest.postBody;
|
const buffer = await serverRequest.postBody;
|
||||||
expect(buffer.length).toBe(arr.length);
|
expect(buffer.length).toBe(arr.length);
|
||||||
for (let i = 0; i < arr.length; ++i)
|
for (let i = 0; i < arr.length; ++i)
|
||||||
|
|
|
||||||
|
|
@ -183,8 +183,8 @@ class TestServer {
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {http.IncomingMessage} request
|
* @param {http.IncomingMessage} request
|
||||||
* @param {http.ServerResponse} response
|
* @param {http.ServerResponse} response
|
||||||
*/
|
*/
|
||||||
_onRequest(request, response) {
|
_onRequest(request, response) {
|
||||||
request.on('error', error => {
|
request.on('error', error => {
|
||||||
|
|
@ -199,7 +199,7 @@ class TestServer {
|
||||||
request.on('end', () => resolve(body));
|
request.on('end', () => resolve(body));
|
||||||
});
|
});
|
||||||
const pathName = url.parse(request.url).path;
|
const pathName = url.parse(request.url).path;
|
||||||
this.debugServer(`request ${pathName}`);
|
this.debugServer(`request ${request.method} ${pathName}`);
|
||||||
if (this._auths.has(pathName)) {
|
if (this._auths.has(pathName)) {
|
||||||
const auth = this._auths.get(pathName);
|
const auth = this._auths.get(pathName);
|
||||||
const credentials = Buffer.from((request.headers.authorization || '').split(' ')[1] || '', 'base64').toString();
|
const credentials = Buffer.from((request.headers.authorization || '').split(' ')[1] || '', 'base64').toString();
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue