mirror of
https://github.com/projectdiscovery/nuclei.git
synced 2025-12-17 19:45:28 +00:00
feat(http): assign customHeaders to the map directly (#5445)
also add skip expr if header key is "Host" Signed-off-by: Dwi Siswanto <git@dw1.io>
This commit is contained in:
parent
33dbb51505
commit
6d325a4ebe
@ -1083,10 +1083,15 @@ func (request *Request) setCustomHeaders(req *generatedRequest) {
|
|||||||
req.rawRequest.Headers[k] = v
|
req.rawRequest.Headers[k] = v
|
||||||
} else {
|
} else {
|
||||||
kk, vv := strings.TrimSpace(k), strings.TrimSpace(v)
|
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" {
|
if kk == "Host" {
|
||||||
req.request.Host = vv
|
req.request.Host = vv
|
||||||
|
|
||||||
|
continue
|
||||||
}
|
}
|
||||||
|
|
||||||
|
req.request.Header[kk] = []string{vv}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user