fix writing of multiple headers with the same name

This commit is contained in:
chestnutprog
2016-10-04 23:21:33 +08:00
committed by Lucas Clemente
parent f511eb0001
commit 02b50e2ffb
2 changed files with 13 additions and 1 deletions

View File

@@ -49,7 +49,9 @@ func (w *responseWriter) WriteHeader(status int) {
enc.WriteField(hpack.HeaderField{Name: ":status", Value: strconv.Itoa(status)})
for k, v := range w.header {
enc.WriteField(hpack.HeaderField{Name: strings.ToLower(k), Value: v[0]})
for index := range v {
enc.WriteField(hpack.HeaderField{Name: strings.ToLower(k), Value: v[index]})
}
}
utils.Infof("Responding with %d", status)