fix: use chrome headers in net.request for everything except cookie (#36666)

This commit is contained in:
Jeremy Rose 2022-12-21 14:53:29 -08:00 committed by GitHub
parent 8c837fda4f
commit 8f23b1527b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 23 additions and 28 deletions

View file

@ -623,6 +623,19 @@ describe('net module', () => {
expect(response.headers['set-cookie']).to.have.same.members(cookie);
});
it('should be able to receive content-type', async () => {
const contentType = 'mime/test; charset=test';
const serverUrl = await respondOnce.toSingleURL((request, response) => {
response.statusCode = 200;
response.statusMessage = 'OK';
response.setHeader('content-type', contentType);
response.end();
});
const urlRequest = net.request(serverUrl);
const response = await getResponse(urlRequest);
expect(response.headers['content-type']).to.equal(contentType);
});
it('should not use the sessions cookie store by default', async () => {
const serverUrl = await respondOnce.toSingleURL((request, response) => {
response.statusCode = 200;