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:
commit
c8839c55a3
1 changed files with 2 additions and 1 deletions
|
@ -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())
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue