pywebpush/py_vapid: VapidException "Missing 'sub' from claims" when sub is an http:// URL
Sending a Web Push with pywebpush 2.5 fails with py_vapid.VapidException: Missing 'sub' from claims. 'sub' is your admin email as a mailto: link. even though vapid_claims={'sub': ...} is set. It happens when the subject is an http:// URL (for example a local dev frontend address such as http://localhost:5173) or an https URL with a port.
py_vapid's _check_sub only accepts mailto:user@host or https://host with no port or path (the https branch of its regex is anchored with $). Anything else is reported with the misleading 'Missing sub' message. Use a mailto: address (e.g. mailto:webmaster@localhost passes for local development) or a bare https://host origin. If the subject defaults from a site URL setting, fall back to a mailto: value when that URL is not https.