Check uris before applying them
This commit is contained in:
8
logo.go
8
logo.go
@@ -11,8 +11,12 @@ type Logo struct {
|
||||
}
|
||||
|
||||
// NewLogo creates a new Logo. It returns a *Logo.
|
||||
func NewLogo(uri string) *Logo {
|
||||
return &Logo{URI: IRI(uri)}
|
||||
func NewLogo(uri IRI) (*Logo, error) {
|
||||
if !isValidIRI(uri) {
|
||||
return nil, fmt.Errorf("uri %v not correctly formatted", uri)
|
||||
}
|
||||
|
||||
return &Logo{URI: uri}, nil
|
||||
}
|
||||
|
||||
// Check checks the Logo for incompatibilities with RFC4287. It returns an
|
||||
|
Reference in New Issue
Block a user