izniburak / appstore-notifications-go

App Store Server Notification V2 Package for Golang
MIT License
35 stars 11 forks source link

Got crash when the JSON input is invalid #4

Open kinfkong opened 3 weeks ago

kinfkong commented 3 weeks ago

andleKatagoUsages" file="/Users/jinggangwang/gochess/ikatago-service/usage/service.go:397" Sep 10 11:45:26 iZ7xva13ausve1mn11cdsgZ ikatago-service[2421962]: 2024/09/10 11:45:26 http: panic serving 127.0.0.1:43234: unexpected end of JSON input Sep 10 11:45:26 iZ7xva13ausve1mn11cdsgZ ikatago-service[2421962]: goroutine 3551070 [running]: Sep 10 11:45:26 iZ7xva13ausve1mn11cdsgZ ikatago-service[2421962]: net/http.(conn).serve.func1() Sep 10 11:45:26 iZ7xva13ausve1mn11cdsgZ ikatago-service[2421962]: /usr/local/go/src/net/http/server.go:1868 +0xb9 Sep 10 11:45:26 iZ7xva13ausve1mn11cdsgZ ikatago-service[2421962]: panic({0xcfd8e0?, 0xc00171c780?}) Sep 10 11:45:26 iZ7xva13ausve1mn11cdsgZ ikatago-service[2421962]: /usr/local/go/src/runtime/panic.go:920 +0x270 Sep 10 11:45:26 iZ7xva13ausve1mn11cdsgZ ikatago-service[2421962]: github.com/izniburak/appstore-notifications-go.(AppStoreServerNotification).parseJwtSignedPayload(0xc00178d5d0, {0x0, 0x0}) Sep 10 11:45:26 iZ7xva13ausve1mn11cdsgZ ikatago-service[2421962]: /Users/jinggangwang/go/pkg/mod/github.com/izniburak/appstore-notifications-go@v1.2.0/v2.go:111 +0x43d Sep 10 11:45:26 iZ7xva13ausve1mn11cdsgZ ikatago-service[2421962]: github.com/izniburak/appstore-notifications-go.New(...) Sep 10 11:45:26 iZ7xva13ausve1mn11cdsgZ ikatago-service[2421962]: /Users/jinggangwang/go/pkg/mod/github.com/izniburak/appstore-notifications-go@v1.2.0/v2.go:19

izniburak commented 3 weeks ago

@kinfkong App Store Connect API might be changed and added/removed some new params. I'll check it and if I find any issue, I'll release a new version of the package.

Also, your data/params are correct, right? Did you check it the params?