Skip to content
This repository has been archived by the owner on Jun 6, 2023. It is now read-only.

Commit

Permalink
Merge pull request #17 from RobotsAndPencils/devicetoken
Browse files Browse the repository at this point in the history
allow larger device tokens
  • Loading branch information
nathany committed Feb 5, 2016
2 parents 10c0bce + 4c5faef commit 24a0dd9
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
2 changes: 1 addition & 1 deletion push/device_token.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import "encoding/hex"
// IsDeviceTokenValid checks if s is a hexadecimal token of the correct length.
func IsDeviceTokenValid(s string) bool {
// TODO: In 2016, they may be growing up to 100 bytes (200 hexadecimal digits).
if len(s) != 64 {
if len(s) < 64 || len(s) > 200 {
return false
}
_, err := hex.DecodeString(s)
Expand Down
1 change: 1 addition & 0 deletions push/device_token_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ func TestInvalidDeviceTokens(t *testing.T) {
func TestValidDeviceToken(t *testing.T) {
tokens := []string{
"c2732227a1d8021cfaf781d71fb2f908c61f5861079a00954a5453f1d0281433",
"c2732227a1d8021cfaf781d71fb2f908c61f5861079a00954ac2732227a1d8021cfaf781d71fb2f908c61f5861079a00954ac2732227a1d8021cfaf781d71fb2f908c61f5861079a00954ac2732227a1d8021cfaf781d71fb2f908c61f5861079a00954a",
}

for _, token := range tokens {
Expand Down

0 comments on commit 24a0dd9

Please sign in to comment.