Skip to content

Wrong Subscription.Keys.Auth value does not return an error #47

Open
@eugbyte

Description

@eugbyte

Wrong Subscription.Keys.Auth value does not return an error

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

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 

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions