Disallow cleartext HTTP for Web Push servers

This commit is contained in:
Vyr Cossont 2025-01-19 16:23:11 -08:00
parent 1dd0adc617
commit 4180024b7e

View File

@ -225,8 +225,7 @@ func validateNormalizeCreate(request *apimodel.WebPushSubscriptionCreateRequest)
if err != nil {
return errors.New("endpoint must be a valid URL")
}
// TODO: (Vyr) remove http option after testing
if endpointURL.Scheme != "https" && endpointURL.Scheme != "http" {
if endpointURL.Scheme != "https" {
return errors.New("endpoint must be an https:// URL")
}
if endpointURL.Host == "" {