@@ -5,13 +5,17 @@ import { validateSchema, transformItemsInCollection, hydrateSeqInCollection, uui
55
66// Content type patterns for matching MIME type variants
77// These patterns handle structured types with many variants (e.g., application/ld+json, application/vnd.api+json)
8+ // MIME types can contain: letters, numbers, hyphens, dots, and plus signs
89const CONTENT_TYPE_PATTERNS = {
910 // Matches: application/json, application/ld+json, application/vnd.api+json, text/json, etc.
10- JSON : / ^ [ \w \- ] + \/ ( [ \w \- ] + \+ ) ? j s o n $ / ,
11- // Matches: application/xml, text/xml, application/atom+xml, application/rss+xml, etc.
12- XML : / ^ [ \w \- ] + \/ ( [ \w \- ] + \+ ) ? x m l $ / ,
13- // Matches: text/html, application/xhtml+xml
14- HTML : / ^ [ \w \- ] + \/ ( [ \w \- ] + \+ ) ? h t m l $ /
11+ // Pattern: type/([base]+)?suffix where suffix is json
12+ JSON : / ^ [ \w \- . + ] + \/ ( [ \w \- . + ] + \+ ) ? j s o n $ / ,
13+ // Matches: application/xml, text/xml, application/atom+xml, application/rss+xml, application/xhtml+xml, etc.
14+ // Pattern: type/([base]+)?suffix where suffix is xml
15+ XML : / ^ [ \w \- . + ] + \/ ( [ \w \- . + ] + \+ ) ? x m l $ / ,
16+ // Matches: text/html
17+ // Pattern: type/([base]+)?suffix where suffix is html
18+ HTML : / ^ [ \w \- . + ] + \/ ( [ \w \- . + ] + \+ ) ? h t m l $ /
1519} ;
1620
1721const ensureUrl = ( url ) => {
0 commit comments