Skip to content

Commit f384a86

Browse files
authored
test(har): uncomment some raw header tests (#4273)
1 parent efdb154 commit f384a86

File tree

3 files changed

+8
-3
lines changed

3 files changed

+8
-3
lines changed

src/server/network.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -183,6 +183,11 @@ export class Request {
183183
this._headersMap.clear();
184184
for (const { name, value } of this._headers)
185185
this._headersMap.set(name.toLowerCase(), value);
186+
if (!this._headersMap.has('host')) {
187+
const host = new URL(this._url).host;
188+
this._headers.push({ name: 'host', value: host });
189+
this._headersMap.set('host', host);
190+
}
186191
}
187192
}
188193

test/network-request.spec.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ it('should return headers', async ({page, server, isChromium, isFirefox, isWebKi
8282
});
8383

8484
it('should get the same headers as the server', (test, { browserName, platform }) => {
85-
test.fail(browserName === 'webkit' && platform !== 'darwin', 'Provisional headers differ from those in network stack');
85+
test.fail(browserName === 'webkit' && platform === 'win32', 'Curl does not show accept-encoding and accept-language');
8686
}, async ({ page, server }) => {
8787
let serverRequest;
8888
server.setRoute('/empty.html', (request, response) => {
@@ -94,7 +94,7 @@ it('should get the same headers as the server', (test, { browserName, platform }
9494
});
9595

9696
it('should get the same headers as the server CORP', (test, { browserName, platform }) => {
97-
test.fail(browserName === 'webkit' && platform !== 'darwin', 'Provisional headers differ from those in network stack');
97+
test.fail(browserName === 'webkit' && platform === 'win32', 'Curl does not show accept-encoding and accept-language');
9898
}, async ({page, server}) => {
9999
await page.goto(server.PREFIX + '/empty.html');
100100
let serverRequest;

test/resource-timing.spec.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ it('should work for subresource', async ({ page, server, isWindows, isWebKit })
4848
expect(timing.secureConnectionStart).toBe(-1);
4949
expect(timing.connectEnd).toBeGreaterThan(timing.secureConnectionStart);
5050
} else {
51-
expect(timing.domainLookupStart).toBe(-1);
51+
expect(timing.domainLookupStart === 0 || timing.domainLookupStart === -1).toBeTruthy();
5252
expect(timing.domainLookupEnd).toBe(-1);
5353
expect(timing.connectStart).toBe(-1);
5454
expect(timing.secureConnectionStart).toBe(-1);

0 commit comments

Comments
 (0)