From 6322566a54a3f80aa7244a1ac9f88aa2b410afc4 Mon Sep 17 00:00:00 2001 From: Jason Streifling Date: Tue, 15 Oct 2024 19:46:45 +0200 Subject: [PATCH] Add function to check if the media type is composite --- atom.go | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/atom.go b/atom.go index d3c7a5b..643acc0 100644 --- a/atom.go +++ b/atom.go @@ -12,6 +12,15 @@ type ( URI string ) +func isCompositeMediaType(mediaType string) bool { + mediaType, _, err := mime.ParseMediaType(mediaType) + if err != nil { + return false + } + + return strings.HasPrefix(mediaType, "multipart/") || strings.HasPrefix(mediaType, "message/") +} + func isXMLMediaType(mediaType string) bool { mediaType, _, err := mime.ParseMediaType(mediaType) if err != nil {