Skip to content

Commit

Permalink
feat(http): assign customHeaders to the map directly (projectdiscov…
Browse files Browse the repository at this point in the history
…ery#5445)

also add skip expr if header key is "Host"

Signed-off-by: Dwi Siswanto <[email protected]>
  • Loading branch information
dwisiswant0 authored Jul 26, 2024
1 parent 33dbb51 commit 6d325a4
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion pkg/protocols/http/request.go
Original file line number Diff line number Diff line change
Expand Up @@ -1083,10 +1083,15 @@ func (request *Request) setCustomHeaders(req *generatedRequest) {
req.rawRequest.Headers[k] = v
} else {
kk, vv := strings.TrimSpace(k), strings.TrimSpace(v)
req.request.Header.Set(kk, vv)
// NOTE(dwisiswant0): Do we really not need to convert it first into
// lowercase?
if kk == "Host" {
req.request.Host = vv

continue
}

req.request.Header[kk] = []string{vv}
}
}
}
Expand Down

0 comments on commit 6d325a4

Please sign in to comment.