### Describe the bug

https://github.com/developer-choi/axios-error-report

TypeError is occurred (in 1.6.6 version)

<img width="184" alt="image" src="https://github.com/axios/axios/assets/51902362/1f7f6e7f-8c8b-4ef7-9854-5c08f572d58b">

<img width="171" alt="image" src="https://github.com/axios/axios/assets/51902362/36042439-a071-485e-b696-9f2c01849759">

### To Reproduce

https://github.com/developer-choi/axios-error-report

### Code snippet

_No response_

### Expected behavior

_No response_

### Axios Version

1.6.6

### Adapter Version

_No response_

### Browser

CHROME

### Browser Version

120.0.6099.225

### Node.js Version

20.11.0

### OS

Window 11
test/unit/adapters/http.js
}).listen(4444, function () {
      var headers = { 'UsEr-AgEnT': 'foo bar' }; /
      axios.get('http://localhost:4444/', { headers }).then(function (res) {
        assert.equal(res.data, 'foo bar');
        done();
      }).catch(done);
    });
  });
  it('should allow the Content-Length header to be overridden', function (done) {
    server = http.createServer(function (req, res) {
      assert.strictEqual(req.headers['content-length'], '42');
      res.end();
    }).listen(4444, function () {
      var headers = { 'CoNtEnT-lEnGtH': '42' }; /
      axios.post('http://localhost:4444/', 'foo', { headers }).then(function () {
        done();
      }).catch(done);
    });
  });
  it('should support max content length', async function () {
    server = await startHTTPServer(function (req, res) {
      res.setHeader('Content-Type', 'text/html; charset=UTF-8');
      res.end(Array(5000).join('#'));
    }, {port: 4444});
    await assert.rejects(() => {
      return axios.get('http://localhost:4444/', {
        maxContentLength: 2000,
        maxRedirects: 0
      })
    },/maxContentLength size of 2000 exceeded/);