@lde/distribution-probe 0.1.3 → 0.1.4

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.
Files changed (2) hide show
  1. package/dist/probe.js +9 -1
  2. package/package.json +1 -1
package/dist/probe.js CHANGED
@@ -202,8 +202,16 @@ async function validateSparqlResponse(response, queryType) {
202
202
  return null;
203
203
  }
204
204
  async function probeDataDump(url, distribution, options, authHeaders, start) {
205
+ // Express a preference for the declared media type, but accept anything as a
206
+ // fallback. Servers that implement RFC 9110 §12.5.1 content negotiation will
207
+ // pick the declared type (preserving our ability to detect real Content-Type
208
+ // mismatches). Servers that reject any non-*/* Accept with 406 — notably
209
+ // Dataverse's /api/access/datafile/ endpoint (IQSS/dataverse#12410) — fall
210
+ // back to */* and return the file unchanged.
205
211
  const headers = new Headers({
206
- Accept: distribution.mimeType ?? '*/*',
212
+ Accept: distribution.mimeType
213
+ ? `${distribution.mimeType}, */*;q=0.5`
214
+ : '*/*',
207
215
  'Accept-Encoding': 'identity',
208
216
  });
209
217
  for (const [key, value] of authHeaders) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lde/distribution-probe",
3
- "version": "0.1.3",
3
+ "version": "0.1.4",
4
4
  "repository": {
5
5
  "url": "git+https://github.com/ldelements/lde.git",
6
6
  "directory": "packages/distribution-probe"