test(har): uncomment some raw header tests (#4273)

This commit is contained in:
Pavel Feldman 2020-10-28 15:58:45 -07:00 committed by GitHub
parent efdb15470c
commit f384a864a8
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 8 additions and 3 deletions

View file

@ -183,6 +183,11 @@ export class Request {
this._headersMap.clear();
for (const { name, value } of this._headers)
this._headersMap.set(name.toLowerCase(), value);
if (!this._headersMap.has('host')) {
const host = new URL(this._url).host;
this._headers.push({ name: 'host', value: host });
this._headersMap.set('host', host);
}
}
}

View file

@ -82,7 +82,7 @@ it('should return headers', async ({page, server, isChromium, isFirefox, isWebKi
});
it('should get the same headers as the server', (test, { browserName, platform }) => {
test.fail(browserName === 'webkit' && platform !== 'darwin', 'Provisional headers differ from those in network stack');
test.fail(browserName === 'webkit' && platform === 'win32', 'Curl does not show accept-encoding and accept-language');
}, async ({ page, server }) => {
let serverRequest;
server.setRoute('/empty.html', (request, response) => {
@ -94,7 +94,7 @@ it('should get the same headers as the server', (test, { browserName, platform }
});
it('should get the same headers as the server CORP', (test, { browserName, platform }) => {
test.fail(browserName === 'webkit' && platform !== 'darwin', 'Provisional headers differ from those in network stack');
test.fail(browserName === 'webkit' && platform === 'win32', 'Curl does not show accept-encoding and accept-language');
}, async ({page, server}) => {
await page.goto(server.PREFIX + '/empty.html');
let serverRequest;

View file

@ -48,7 +48,7 @@ it('should work for subresource', async ({ page, server, isWindows, isWebKit })
expect(timing.secureConnectionStart).toBe(-1);
expect(timing.connectEnd).toBeGreaterThan(timing.secureConnectionStart);
} else {
expect(timing.domainLookupStart).toBe(-1);
expect(timing.domainLookupStart === 0 || timing.domainLookupStart === -1).toBeTruthy();
expect(timing.domainLookupEnd).toBe(-1);
expect(timing.connectStart).toBe(-1);
expect(timing.secureConnectionStart).toBe(-1);