non ported html fix
This commit is contained in:
@@ -1,6 +1,7 @@
|
|||||||
package event
|
package event
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
"bytes"
|
||||||
"crypto/rand"
|
"crypto/rand"
|
||||||
"crypto/sha256"
|
"crypto/sha256"
|
||||||
"encoding/hex"
|
"encoding/hex"
|
||||||
@@ -81,8 +82,12 @@ func (evt *Event) Serialize() []byte {
|
|||||||
// content
|
// content
|
||||||
arr[5] = evt.Content
|
arr[5] = evt.Content
|
||||||
|
|
||||||
serialized, _ := json.Marshal(arr)
|
serialized := new(bytes.Buffer)
|
||||||
return serialized
|
|
||||||
|
enc := json.NewEncoder(serialized)
|
||||||
|
enc.SetEscapeHTML(false)
|
||||||
|
_ = enc.Encode(arr)
|
||||||
|
return serialized.Bytes()[:serialized.Len()-1] // Encode add new line char
|
||||||
}
|
}
|
||||||
|
|
||||||
// CheckSignature checks if the signature is valid for the id
|
// CheckSignature checks if the signature is valid for the id
|
||||||
|
|||||||
Reference in New Issue
Block a user