@lde/distribution-probe 0.1.6 → 0.1.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/probe.js +4 -1
- package/package.json +1 -1
package/dist/probe.js
CHANGED
|
@@ -320,7 +320,10 @@ async function validateBody(body, contentType, baseIRI, timeoutMs) {
|
|
|
320
320
|
if (body.length === 0) {
|
|
321
321
|
return 'Distribution is empty';
|
|
322
322
|
}
|
|
323
|
-
|
|
323
|
+
// Media types are case-insensitive (RFC 9110 §8.3.1), so normalise before
|
|
324
|
+
// matching the lower-case allow-list — a server sending `Application/LD+JSON`
|
|
325
|
+
// must still have its body validated.
|
|
326
|
+
const serialization = contentType?.split(';')[0].trim().toLowerCase();
|
|
324
327
|
if (!serialization || !rdfContentTypes.includes(serialization)) {
|
|
325
328
|
return null;
|
|
326
329
|
}
|