Open eugbyte opened 1 year ago
Wrong Subscription.Keys.Auth value does not return an error
Subscription.Keys.Auth
For example, if I were to append a random value to the Auth field as such,
sub := &webpush.Subscription{ Endpoint: endpoint, Keys: webpush.Keys{ Auth: "my_auth" + "a", P256dh: "my_p256dh", }, }
I still get status code 201 when calling webpush.SendNotification(), indicating that the request to send a push message was received and accepted
201
webpush.SendNotification()
resp, err := webpush.SendNotification([]byte(message), sub, &webpush.Options{ Subscriber: "my_email", VAPIDPublicKey: "my_public_key", VAPIDPrivateKey: "my_private_key", TTL: ttl, }) fmt.Println(resp.Status, resp.StatusCode) // "201 Created" 201
I notice that so long as the appended value to Subscription.Keys.Auth does not exceed length of 2, no error is returned. Otherwise, the error message will be illegal base64 data at input byte 25
illegal base64 data at input byte 25
Wrong
Subscription.Keys.Auth
value does not return an errorFor example, if I were to append a random value to the Auth field as such,
I still get status code
201
when callingwebpush.SendNotification()
, indicating that the request to send a push message was received and accepted