fix Send(): FINAL + TYPE were hard-coded
This commit is contained in:
parent
7fa43b2c00
commit
98ce1dddbe
|
@ -166,7 +166,11 @@ func (m Message) Send(writer io.Writer) error {
|
|||
}
|
||||
|
||||
/* (1) Byte 0 : FIN + opcode */
|
||||
header = append(header, 0x80 | byte(TEXT) )
|
||||
var final byte = 0x80
|
||||
if !m.Final {
|
||||
final = 0
|
||||
}
|
||||
header = append(header, final | byte(m.Type) )
|
||||
|
||||
/* (2) Get payload length */
|
||||
if m.Size < 126 { // simple
|
||||
|
|
Loading…
Reference in New Issue