Fix #5 - support leading tab on multi-line header

This commit is contained in:
Ian Kent 2014-11-13 18:17:00 +00:00
parent 1bc68344f9
commit 90dc75e392

View file

@ -144,7 +144,7 @@ func ContentFromString(data string) *Content {
hdrs := strings.Split(headers, "\r\n")
var lastHdr = ""
for _, hdr := range hdrs {
if lastHdr != "" && strings.HasPrefix(hdr, " ") {
if lastHdr != "" && (strings.HasPrefix(hdr, " ") || strings.HasPrefix(hdr, "\t")) {
h[lastHdr][len(h[lastHdr])-1] = h[lastHdr][len(h[lastHdr])-1] + hdr
} else if strings.Contains(hdr, ": ") {
y := strings.SplitN(hdr, ": ", 2)