You can clone with
Currently, request checks that if the 'Host' header is present in the options but only checks the lowercase version: https://github.com/mikeal/request/blob/b85bf633fe8197dc38855f10016a0a76a8ab600a/main.js#L187
What I see is that I can't set the 'Host' header with capitalization because it is ultimately overwritten by 'host'. I would like to, for the sake of agreement with standard protocol , set 'Host' instead of 'host', but I'm unable to. Can the check on the line I linked to be made case-insensitive? I can provide a patch if necessary.
Ideally, I'd love for the header that request sets itself to also be capitalized so that I don't have to override the capitalization, but at least the check should be case-insensitive.
See also #411
we need either a getHeader or headerExists method that is caseless. I think the ideal API is
r.getHeader('HoSt') // returns value or undefined
If you want to find the casing yourself you can just iterate over the headers object.
I see getHeader on line 815 already (though it also takes as input the headers object), so the check for 'Host' should be using that as far as I can tell.