1
0
Fork 0
mirror of https://github.com/anyproto/anytype-heart.git synced 2025-06-09 09:35:00 +09:00

GO-625 Trim spaces in URL relation

Trim spaces in URL relation
This commit is contained in:
Kirill Stonozhenko 2022-12-15 17:38:28 +01:00 committed by GitHub
commit c8839c55a3
Signed by: github
GPG key ID: 4AEE18F83AFDEB23

View file

@ -4,6 +4,7 @@ import (
"errors"
"fmt"
"net/url"
"strings"
"sync"
"github.com/globalsign/mgo/bson"
@ -378,7 +379,7 @@ func (s *service) ValidateFormat(key string, v *types.Value) error {
return fmt.Errorf("incorrect type: %T instead of string", v.Kind)
}
_, err := url.Parse(v.GetStringValue())
_, err := url.Parse(strings.TrimSpace(v.GetStringValue()))
if err != nil {
return fmt.Errorf("failed to parse URL: %s", err.Error())
}