Change URI to IRI after finding validation pattern
This commit is contained in:
@@ -10,7 +10,7 @@ import (
|
||||
type OutOfLineContent struct {
|
||||
*CommonAttributes
|
||||
Type MediaType `xml:"type,attr,omitempty"`
|
||||
SRC URI `xml:"src,attr"`
|
||||
SRC IRI `xml:"src,attr"`
|
||||
}
|
||||
|
||||
func newOutOfLineContent(mediaType string, content any) (*OutOfLineContent, error) {
|
||||
@@ -22,11 +22,11 @@ func newOutOfLineContent(mediaType string, content any) (*OutOfLineContent, erro
|
||||
return nil, fmt.Errorf("content type %T incompatible with out of line content", content)
|
||||
}
|
||||
|
||||
if !isValidURI(content.(URI)) {
|
||||
if !isValidIRI(content.(IRI)) {
|
||||
return nil, errors.New("content not a valid uri")
|
||||
}
|
||||
|
||||
return &OutOfLineContent{Type: MediaType(mediaType), SRC: content.(URI)}, nil
|
||||
return &OutOfLineContent{Type: MediaType(mediaType), SRC: content.(IRI)}, nil
|
||||
}
|
||||
|
||||
func (o *OutOfLineContent) isContent() bool { return true }
|
||||
|
Reference in New Issue
Block a user