fix(backend): legacy transform with meta

This commit is contained in:
ShiKhu 2021-07-22 11:56:38 +08:00
parent fb398f52ed
commit 829fffcfb4
2 changed files with 5 additions and 2 deletions

View file

@ -4,7 +4,10 @@ package messages
func transformDepricated(msg Message) Message {
switch m := msg.(type) {
case *MouseClickDepricated:
return &MouseClick {
meta := m.Meta()
meta.TypeID = 33
return &MouseClick{
meta: meta,
ID: m.ID,
HesitationTime: m.HesitationTime,
Label: m.Label,

View file

@ -66,7 +66,7 @@ func main() {
w.Header().Set("Access-Control-Allow-Methods", "POST")
w.Header().Set("Access-Control-Allow-Headers", "Content-Type,Authorization")
if r.Method == http.MethodOptions {
//w.Header().Set("Cache-Control", "max-age=86400")
w.Header().Set("Cache-Control", "max-age=86400")
w.WriteHeader(http.StatusOK)
return
}