allow non canonical header name

dev
Mzack9999 2020-07-17 16:04:13 +02:00
parent c346087926
commit c195bdb2f8
2 changed files with 4 additions and 4 deletions

View File

@ -304,7 +304,7 @@ func (e *HTTPExecuter) setCustomHeaders(r *requests.CompiledHTTP) {
headerName, headerValue := tokens[0], strings.Join(tokens[1:], "") headerName, headerValue := tokens[0], strings.Join(tokens[1:], "")
headerName = strings.TrimSpace(headerName) headerName = strings.TrimSpace(headerName)
headerValue = strings.TrimSpace(headerValue) headerValue = strings.TrimSpace(headerValue)
r.Request.Header.Set(headerName, headerValue) r.Request.Header[headerName] = []string{headerValue}
} }
} }

View File

@ -189,7 +189,7 @@ func (r *HTTPRequest) handleSimpleRaw(raw string, baseURL string, values map[str
// copy headers // copy headers
for key, value := range compiledRequest.Headers { for key, value := range compiledRequest.Headers {
req.Header.Set(key, value) req.Header[key] = []string{value}
} }
request, err := r.fillRequest(req, values) request, err := r.fillRequest(req, values)
@ -244,7 +244,7 @@ func (r *HTTPRequest) handleRawWithPaylods(raw string, baseURL string, values, g
// copy headers // copy headers
for key, value := range compiledRequest.Headers { for key, value := range compiledRequest.Headers {
req.Header.Set(key, value) req.Header[key] = []string{value}
} }
request, err := r.fillRequest(req, values) 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 // Set the header values requested
for header, value := range r.Headers { 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 // Set some headers only if the header wasn't supplied by the user