split header string once with SplitN 2
dev
Víctor Zamanillo 2020-09-02 10:01:45 +02:00
parent 2e81db31ef
commit 4ebd6ad58d
1 changed files with 1 additions and 1 deletions

View File

@ -369,7 +369,7 @@ func makeCheckRedirectFunc(followRedirects bool, maxRedirects int) checkRedirect
func (e *HTTPExecuter) setCustomHeaders(r *requests.HTTPRequest) { func (e *HTTPExecuter) setCustomHeaders(r *requests.HTTPRequest) {
for _, customHeader := range e.customHeaders { for _, customHeader := range e.customHeaders {
// This should be pre-computed somewhere and done only once // This should be pre-computed somewhere and done only once
tokens := strings.Split(customHeader, ":") tokens := strings.SplitN(customHeader, ":", 2)
// if it's an invalid header skip it // if it's an invalid header skip it
if len(tokens) < two { if len(tokens) < two {
continue continue