elazarl / goproxy

An HTTP proxy library for Go
BSD 3-Clause "New" or "Revised" License
6.06k stars 1.1k forks source link

Avoid Header Canonicalization in copyHeaders by Using Direct Assignment #553

Open alessiodallapiazza opened 1 week ago

alessiodallapiazza commented 1 week ago

This PR updates the copyHeaders function to avoid the canonicalization of HTTP header keys caused by the Add method. Instead of using Add, the function now directly assigns header values from src to dst, preserving their original casing.

Let me know if further adjustments are needed!

Closes: https://github.com/elazarl/goproxy/issues/403