mirror of
https://github.com/superseriousbusiness/gotosocial.git
synced 2025-11-10 04:37:28 -06:00
Linter fixes
This commit is contained in:
parent
8b9a228ea2
commit
2cb7a8bf2a
4 changed files with 28 additions and 8 deletions
|
|
@ -224,18 +224,18 @@ func validateNormalizeCreate(request *apimodel.WebPushSubscriptionCreateRequest)
|
|||
if request.Subscription.Endpoint == "" {
|
||||
return errors.New("endpoint is required")
|
||||
}
|
||||
endpointUrl, err := url.Parse(request.Subscription.Endpoint)
|
||||
endpointURL, err := url.Parse(request.Subscription.Endpoint)
|
||||
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" && endpointURL.Scheme != "http" {
|
||||
return errors.New("endpoint must be an https:// URL")
|
||||
}
|
||||
if endpointUrl.Host == "" {
|
||||
if endpointURL.Host == "" {
|
||||
return errors.New("endpoint URL must have a host")
|
||||
}
|
||||
if endpointUrl.Fragment != "" {
|
||||
if endpointURL.Fragment != "" {
|
||||
return errors.New("endpoint URL must not have a fragment")
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue