fix crash on missing payload metadata

This commit is contained in:
pbsurf
2015-11-04 20:40:44 +00:00
parent a4c40cd8b4
commit 5c272661e9
4 changed files with 12 additions and 1 deletions
+3
View File
@@ -67,6 +67,9 @@ func payloadBody(payload []byte) []byte {
func payloadMeta(payload []byte) [][]byte {
headerSize := bytes.IndexByte(payload, '\n')
if headerSize < 0 {
headerSize = 0;
}
return bytes.Split(payload[:headerSize], []byte{' '})
}