Skip to content

Commit 7c75148

Browse files
committed
fix: return error for invalid device token removal
1 parent d819f7d commit 7c75148

1 file changed

Lines changed: 1 addition & 0 deletions

File tree

route_push.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -264,6 +264,7 @@ func push(params map[string]interface{}) (int, error) {
264264
// Remove deviceToken if it’s too long, to clean up junk data.
265265
if len(deviceToken) > 128 {
266266
_ = db.DeleteDeviceByKey(msg.DeviceKey)
267+
return 400, fmt.Errorf("invalid device token, has been removed")
267268
}
268269

269270
msg.DeviceToken = deviceToken

0 commit comments

Comments
 (0)