mirror of https://github.com/daffainfo/nuclei.git
allow non canonical header name
parent
c346087926
commit
c195bdb2f8
|
@ -304,7 +304,7 @@ func (e *HTTPExecuter) setCustomHeaders(r *requests.CompiledHTTP) {
|
|||
headerName, headerValue := tokens[0], strings.Join(tokens[1:], "")
|
||||
headerName = strings.TrimSpace(headerName)
|
||||
headerValue = strings.TrimSpace(headerValue)
|
||||
r.Request.Header.Set(headerName, headerValue)
|
||||
r.Request.Header[headerName] = []string{headerValue}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -189,7 +189,7 @@ func (r *HTTPRequest) handleSimpleRaw(raw string, baseURL string, values map[str
|
|||
|
||||
// copy headers
|
||||
for key, value := range compiledRequest.Headers {
|
||||
req.Header.Set(key, value)
|
||||
req.Header[key] = []string{value}
|
||||
}
|
||||
|
||||
request, err := r.fillRequest(req, values)
|
||||
|
@ -244,7 +244,7 @@ func (r *HTTPRequest) handleRawWithPaylods(raw string, baseURL string, values, g
|
|||
|
||||
// copy headers
|
||||
for key, value := range compiledRequest.Headers {
|
||||
req.Header.Set(key, value)
|
||||
req.Header[key] = []string{value}
|
||||
}
|
||||
|
||||
request, err := r.fillRequest(req, values)
|
||||
|
@ -267,7 +267,7 @@ func (r *HTTPRequest) fillRequest(req *http.Request, values map[string]interface
|
|||
|
||||
// Set the header values requested
|
||||
for header, value := range r.Headers {
|
||||
req.Header.Set(header, replacer.Replace(value))
|
||||
req.Header[header] = []string{replacer.Replace(value)}
|
||||
}
|
||||
|
||||
// Set some headers only if the header wasn't supplied by the user
|
||||
|
|
Loading…
Reference in New Issue