http header to lowercase

dev
Mzack9999 2020-04-28 03:23:51 +02:00
parent ecd598da9b
commit 1b60c87312
1 changed files with 1 additions and 1 deletions

View File

@ -15,7 +15,7 @@ func httpToMap(resp *http.Response, body, headers string) (m map[string]interfac
m["content_length"] = resp.ContentLength m["content_length"] = resp.ContentLength
m["status_code"] = resp.StatusCode m["status_code"] = resp.StatusCode
for k, v := range resp.Header { for k, v := range resp.Header {
k = strings.TrimSpace(strings.Replace(k, "-", "_", -1)) k = strings.ToLower(strings.TrimSpace(strings.Replace(k, "-", "_", -1)))
m[k] = strings.Join(v, " ") m[k] = strings.Join(v, " ")
} }
m["all_headers"] = headers m["all_headers"] = headers