Skip to main content

inspect_subscription

Function inspect_subscription 

Source
pub fn inspect_subscription(json: &str) -> Result<SubscriptionReport, String>
Expand description

Validates a Web Push subscription and works out the aud the adapter will use for it.

Every check is the adapter’s own — origin_of for the audience, SubscriptionKeys::parse for the two keys — so a subscription this accepts is one the adapter accepts, and a reason this gives is the reason a send would have failed with.

§Errors

When the JSON is not a subscription, the endpoint has no usable origin, or either key is the wrong length or encoding.