File tree 1 file changed +8
-0
lines changed
1 file changed +8
-0
lines changed Original file line number Diff line number Diff line change @@ -24,6 +24,9 @@ const priorityOverrides = {
24
24
'application/n-quads' : 0.6 ,
25
25
} ;
26
26
27
+ // CIDOC serves its rdf/xml with a text/html content type. ARGH!
28
+ const rdfPattern = / < \? x m l [ ^ ] + < r d f : r d f [ ^ ] + < \/ r d f : r d f / i;
29
+
27
30
const defaultSyncOptions = ( function ( ) {
28
31
let optionsPromise : any ;
29
32
@@ -86,6 +89,11 @@ export function transform(jqXHR: JQuery.jqXHR): Promise<[
86
89
} else {
87
90
plaintext = jqXHR . responseText ;
88
91
}
92
+ if ( contentType === 'text/html' && rdfPattern . test ( plaintext ) ) {
93
+ // Workaround for improper content negotiation in CIDOC and possibly
94
+ // other vocabularies.
95
+ contentType = 'application/rdf+xml' ;
96
+ }
89
97
const input = streamify ( plaintext ) ;
90
98
const serializer = new Serializer ( ) ;
91
99
return new Promise ( ( resolve , reject ) => {
You can’t perform that action at this time.
0 commit comments