mirror of
https://github.com/AikidoSec/safe-chain.git
synced 2026-05-26 12:10:49 +00:00
Add small comment on why we're removing the host header before forwarding.
This commit is contained in:
parent
faae0488c8
commit
0a8dacda24
1 changed files with 2 additions and 0 deletions
|
|
@ -151,6 +151,8 @@ function forwardRequest(req, hostname, res, requestHandler) {
|
|||
function createProxyRequest(hostname, req, res, requestHandler) {
|
||||
/** @type {NodeJS.Dict<string | string[]> | undefined} */
|
||||
let headers = { ...req.headers };
|
||||
// Remove the host header from the incoming request before forwarding.
|
||||
// Node's http module sets the correct host header for the target hostname automatically.
|
||||
if (headers.host) {
|
||||
delete headers.host;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue