http: refactor outgoing headers processing
Use a shared function, for..in instead of Object.keys, do less work in
setHeader
and instead defer some of it until later, and other minor
changes to improve clarity, as well as a slight boost in performance.
Checklist
-
make -j4 test
(UNIX), orvcbuild test
(Windows) passes -
tests and/or benchmarks are included -
documentation is changed or added -
commit message follows commit guidelines