2024-10-13 17:19:40 +02:00
|
|
|
package atomfeed
|
|
|
|
|
2024-10-15 19:46:26 +02:00
|
|
|
import (
|
|
|
|
"mime"
|
|
|
|
"strings"
|
|
|
|
)
|
2024-10-15 19:40:13 +02:00
|
|
|
|
2024-10-13 17:19:40 +02:00
|
|
|
type (
|
|
|
|
EmailAddress string
|
|
|
|
LanguageTag string
|
|
|
|
MediaType string
|
|
|
|
URI string
|
|
|
|
)
|
2024-10-15 19:40:13 +02:00
|
|
|
|
|
|
|
func isXMLMediaType(mediaType string) bool {
|
2024-10-15 19:46:26 +02:00
|
|
|
mediaType, _, err := mime.ParseMediaType(mediaType)
|
|
|
|
if err != nil {
|
|
|
|
return false
|
|
|
|
}
|
|
|
|
|
2024-10-15 19:40:13 +02:00
|
|
|
return strings.HasSuffix(mediaType, "/xml") || strings.HasSuffix(mediaType, "+xml")
|
|
|
|
}
|