@helia/verified-fetch 0.0.0-7a7c0c1 → 0.0.0-7c3ce21

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 (48) hide show
  1. package/README.md +238 -6
  2. package/dist/index.min.js +4 -4
  3. package/dist/src/index.d.ts +222 -4
  4. package/dist/src/index.d.ts.map +1 -1
  5. package/dist/src/index.js +219 -4
  6. package/dist/src/index.js.map +1 -1
  7. package/dist/src/types.d.ts +2 -0
  8. package/dist/src/types.d.ts.map +1 -0
  9. package/dist/src/types.js +2 -0
  10. package/dist/src/types.js.map +1 -0
  11. package/dist/src/utils/dag-cbor-to-safe-json.d.ts +7 -0
  12. package/dist/src/utils/dag-cbor-to-safe-json.d.ts.map +1 -0
  13. package/dist/src/utils/dag-cbor-to-safe-json.js +37 -0
  14. package/dist/src/utils/dag-cbor-to-safe-json.js.map +1 -0
  15. package/dist/src/utils/get-content-disposition-filename.d.ts +6 -0
  16. package/dist/src/utils/get-content-disposition-filename.d.ts.map +1 -0
  17. package/dist/src/utils/get-content-disposition-filename.js +16 -0
  18. package/dist/src/utils/get-content-disposition-filename.js.map +1 -0
  19. package/dist/src/utils/get-e-tag.d.ts +28 -0
  20. package/dist/src/utils/get-e-tag.d.ts.map +1 -0
  21. package/dist/src/utils/get-e-tag.js +18 -0
  22. package/dist/src/utils/get-e-tag.js.map +1 -0
  23. package/dist/src/utils/parse-url-string.d.ts +7 -1
  24. package/dist/src/utils/parse-url-string.d.ts.map +1 -1
  25. package/dist/src/utils/parse-url-string.js +6 -0
  26. package/dist/src/utils/parse-url-string.js.map +1 -1
  27. package/dist/src/utils/responses.d.ts +4 -0
  28. package/dist/src/utils/responses.d.ts.map +1 -0
  29. package/dist/src/utils/responses.js +21 -0
  30. package/dist/src/utils/responses.js.map +1 -0
  31. package/dist/src/utils/select-output-type.d.ts +12 -0
  32. package/dist/src/utils/select-output-type.d.ts.map +1 -0
  33. package/dist/src/utils/select-output-type.js +147 -0
  34. package/dist/src/utils/select-output-type.js.map +1 -0
  35. package/dist/src/verified-fetch.d.ts +17 -25
  36. package/dist/src/verified-fetch.d.ts.map +1 -1
  37. package/dist/src/verified-fetch.js +220 -143
  38. package/dist/src/verified-fetch.js.map +1 -1
  39. package/package.json +25 -15
  40. package/src/index.ts +223 -4
  41. package/src/types.ts +1 -0
  42. package/src/utils/dag-cbor-to-safe-json.ts +44 -0
  43. package/src/utils/get-content-disposition-filename.ts +18 -0
  44. package/src/utils/get-e-tag.ts +36 -0
  45. package/src/utils/parse-url-string.ts +17 -2
  46. package/src/utils/responses.ts +22 -0
  47. package/src/utils/select-output-type.ts +166 -0
  48. package/src/verified-fetch.ts +251 -153
@@ -1,17 +1,20 @@
1
- import { dagCbor as heliaDagCbor } from '@helia/dag-cbor';
2
- import { dagJson as heliaDagJson } from '@helia/dag-json';
3
1
  import { ipns as heliaIpns } from '@helia/ipns';
4
2
  import { dnsJsonOverHttps } from '@helia/ipns/dns-resolvers';
5
- import { json as heliaJson } from '@helia/json';
6
3
  import { unixfs as heliaUnixFs } from '@helia/unixfs';
7
- import { code as dagCborCode } from '@ipld/dag-cbor';
8
- import { code as dagJsonCode } from '@ipld/dag-json';
4
+ import * as ipldDagCbor from '@ipld/dag-cbor';
5
+ import * as ipldDagJson from '@ipld/dag-json';
9
6
  import { code as dagPbCode } from '@ipld/dag-pb';
10
7
  import { code as jsonCode } from 'multiformats/codecs/json';
11
- import { decode, code as rawCode } from 'multiformats/codecs/raw';
8
+ import { code as rawCode } from 'multiformats/codecs/raw';
9
+ import { identity } from 'multiformats/hashes/identity';
12
10
  import { CustomProgressEvent } from 'progress-events';
11
+ import { dagCborToSafeJSON } from './utils/dag-cbor-to-safe-json.js';
12
+ import { getContentDispositionFilename } from './utils/get-content-disposition-filename.js';
13
+ import { getETag } from './utils/get-e-tag.js';
13
14
  import { getStreamFromAsyncIterable } from './utils/get-stream-from-async-iterable.js';
14
15
  import { parseResource } from './utils/parse-resource.js';
16
+ import { notAcceptableResponse, notSupportedResponse, okResponse } from './utils/responses.js';
17
+ import { selectOutputType, queryFormatToAcceptHeader } from './utils/select-output-type.js';
15
18
  import { walkPath } from './utils/walk-path.js';
16
19
  function convertOptions(options) {
17
20
  if (options == null) {
@@ -26,17 +29,42 @@ function convertOptions(options) {
26
29
  signal
27
30
  };
28
31
  }
32
+ /**
33
+ * These are Accept header values that will cause content type sniffing to be
34
+ * skipped and set to these values.
35
+ */
36
+ const RAW_HEADERS = [
37
+ 'application/vnd.ipld.raw',
38
+ 'application/octet-stream'
39
+ ];
40
+ /**
41
+ * if the user has specified an `Accept` header, and it's in our list of
42
+ * allowable "raw" format headers, use that instead of detecting the content
43
+ * type. This avoids the user from receiving something different when they
44
+ * signal that they want to `Accept` a specific mime type.
45
+ */
46
+ function getOverridenRawContentType(headers) {
47
+ const acceptHeader = new Headers(headers).get('accept') ?? '';
48
+ // e.g. "Accept: text/html, application/xhtml+xml, application/xml;q=0.9, image/webp, */*;q=0.8"
49
+ const acceptHeaders = acceptHeader.split(',')
50
+ .map(s => s.split(';')[0])
51
+ .map(s => s.trim());
52
+ for (const mimeType of acceptHeaders) {
53
+ if (mimeType === '*/*') {
54
+ return;
55
+ }
56
+ if (RAW_HEADERS.includes(mimeType ?? '')) {
57
+ return mimeType;
58
+ }
59
+ }
60
+ }
29
61
  export class VerifiedFetch {
30
62
  helia;
31
63
  ipns;
32
64
  unixfs;
33
- dagJson;
34
- dagCbor;
35
- json;
36
- pathWalker;
37
65
  log;
38
66
  contentTypeParser;
39
- constructor({ helia, ipns, unixfs, dagJson, json, dagCbor, pathWalker }, init) {
67
+ constructor({ helia, ipns, unixfs }, init) {
40
68
  this.helia = helia;
41
69
  this.log = helia.logger.forComponent('helia:verified-fetch');
42
70
  this.ipns = ipns ?? heliaIpns(helia, {
@@ -46,63 +74,110 @@ export class VerifiedFetch {
46
74
  ]
47
75
  });
48
76
  this.unixfs = unixfs ?? heliaUnixFs(helia);
49
- this.dagJson = dagJson ?? heliaDagJson(helia);
50
- this.json = json ?? heliaJson(helia);
51
- this.dagCbor = dagCbor ?? heliaDagCbor(helia);
52
- this.pathWalker = pathWalker ?? walkPath;
53
77
  this.contentTypeParser = init?.contentTypeParser;
54
78
  this.log.trace('created VerifiedFetch instance');
55
79
  }
56
- // handle vnd.ipfs.ipns-record
57
- async handleIPNSRecord({ cid, path, options }) {
58
- const response = new Response('vnd.ipfs.ipns-record support is not implemented', { status: 501 });
59
- response.headers.set('X-Content-Type-Options', 'nosniff'); // see https://specs.ipfs.tech/http-gateways/path-gateway/#x-content-type-options-response-header
60
- return response;
80
+ /**
81
+ * Accepts an `ipns://...` URL as a string and returns a `Response` containing
82
+ * a raw IPNS record.
83
+ */
84
+ async handleIPNSRecord(resource, opts) {
85
+ return notSupportedResponse('vnd.ipfs.ipns-record support is not implemented');
61
86
  }
62
- // handle vnd.ipld.car
63
- async handleIPLDCar({ cid, path, options }) {
64
- const response = new Response('vnd.ipld.car support is not implemented', { status: 501 });
65
- response.headers.set('X-Content-Type-Options', 'nosniff'); // see https://specs.ipfs.tech/http-gateways/path-gateway/#x-content-type-options-response-header
66
- return response;
87
+ /**
88
+ * Accepts a `CID` and returns a `Response` with a body stream that is a CAR
89
+ * of the `DAG` referenced by the `CID`.
90
+ */
91
+ async handleCar({ cid, path, options }) {
92
+ return notSupportedResponse('vnd.ipld.car support is not implemented');
67
93
  }
68
- async handleDagJson({ cid, path, options }) {
69
- this.log.trace('fetching %c/%s', cid, path);
70
- options?.onProgress?.(new CustomProgressEvent('verified-fetch:request:start', { cid, path }));
71
- const result = await this.dagJson.get(cid, {
72
- signal: options?.signal,
73
- onProgress: options?.onProgress
74
- });
75
- options?.onProgress?.(new CustomProgressEvent('verified-fetch:request:end', { cid, path }));
76
- const response = new Response(JSON.stringify(result), { status: 200 });
77
- response.headers.set('content-type', 'application/json');
78
- return response;
94
+ /**
95
+ * Accepts a UnixFS `CID` and returns a `.tar` file containing the file or
96
+ * directory structure referenced by the `CID`.
97
+ */
98
+ async handleTar({ cid, path, options }) {
99
+ if (cid.code !== dagPbCode) {
100
+ return notAcceptableResponse('only dag-pb CIDs can be returned in TAR files');
101
+ }
102
+ return notSupportedResponse('application/tar support is not implemented');
79
103
  }
80
- async handleJson({ cid, path, options }) {
104
+ async handleJson({ cid, path, accept, options }) {
81
105
  this.log.trace('fetching %c/%s', cid, path);
82
- options?.onProgress?.(new CustomProgressEvent('verified-fetch:request:start', { cid, path }));
83
- const result = await this.json.get(cid, {
84
- signal: options?.signal,
85
- onProgress: options?.onProgress
86
- });
87
- options?.onProgress?.(new CustomProgressEvent('verified-fetch:request:end', { cid, path }));
88
- const response = new Response(JSON.stringify(result), { status: 200 });
89
- response.headers.set('content-type', 'application/json');
106
+ const block = await this.helia.blockstore.get(cid, options);
107
+ let body;
108
+ if (accept === 'application/vnd.ipld.dag-cbor' || accept === 'application/cbor') {
109
+ try {
110
+ // if vnd.ipld.dag-cbor has been specified, convert to the format - note
111
+ // that this supports more data types than regular JSON, the content-type
112
+ // response header is set so the user knows to process it differently
113
+ const obj = ipldDagJson.decode(block);
114
+ body = ipldDagCbor.encode(obj);
115
+ }
116
+ catch (err) {
117
+ this.log.error('could not transform %c to application/vnd.ipld.dag-cbor', err);
118
+ return notAcceptableResponse();
119
+ }
120
+ }
121
+ else {
122
+ // skip decoding
123
+ body = block;
124
+ }
125
+ const response = okResponse(body);
126
+ response.headers.set('content-type', accept ?? 'application/json');
90
127
  return response;
91
128
  }
92
- async handleDagCbor({ cid, path, options }) {
129
+ async handleDagCbor({ cid, path, accept, options }) {
93
130
  this.log.trace('fetching %c/%s', cid, path);
94
- options?.onProgress?.(new CustomProgressEvent('verified-fetch:request:start', { cid, path }));
95
- const result = await this.dagCbor.get(cid, {
96
- signal: options?.signal,
97
- onProgress: options?.onProgress
98
- });
99
- options?.onProgress?.(new CustomProgressEvent('verified-fetch:request:end', { cid, path }));
100
- const response = new Response(result, { status: 200 });
101
- await this.setContentType(result, path, response);
131
+ const block = await this.helia.blockstore.get(cid, options);
132
+ let body;
133
+ if (accept === 'application/octet-stream' || accept === 'application/vnd.ipld.dag-cbor' || accept === 'application/cbor') {
134
+ // skip decoding
135
+ body = block;
136
+ }
137
+ else if (accept === 'application/vnd.ipld.dag-json') {
138
+ try {
139
+ // if vnd.ipld.dag-json has been specified, convert to the format - note
140
+ // that this supports more data types than regular JSON, the content-type
141
+ // response header is set so the user knows to process it differently
142
+ const obj = ipldDagCbor.decode(block);
143
+ body = ipldDagJson.encode(obj);
144
+ }
145
+ catch (err) {
146
+ this.log.error('could not transform %c to application/vnd.ipld.dag-json', err);
147
+ return notAcceptableResponse();
148
+ }
149
+ }
150
+ else {
151
+ try {
152
+ body = dagCborToSafeJSON(block);
153
+ }
154
+ catch (err) {
155
+ if (accept === 'application/json') {
156
+ this.log('could not decode DAG-CBOR as JSON-safe, but the client sent "Accept: application/json"', err);
157
+ return notAcceptableResponse();
158
+ }
159
+ this.log('could not decode DAG-CBOR as JSON-safe, falling back to `application/octet-stream`', err);
160
+ body = block;
161
+ }
162
+ }
163
+ const response = okResponse(body);
164
+ if (accept == null) {
165
+ accept = body instanceof Uint8Array ? 'application/octet-stream' : 'application/json';
166
+ }
167
+ response.headers.set('content-type', accept);
102
168
  return response;
103
169
  }
104
- async handleDagPb({ cid, path, options, terminalElement }) {
105
- this.log.trace('fetching %c/%s', cid, path);
170
+ async handleDagPb({ cid, path, options }) {
171
+ let terminalElement;
172
+ let ipfsRoots;
173
+ try {
174
+ const pathDetails = await walkPath(this.helia.blockstore, `${cid.toString()}/${path}`, options);
175
+ ipfsRoots = pathDetails.ipfsRoots;
176
+ terminalElement = pathDetails.terminalElement;
177
+ }
178
+ catch (err) {
179
+ this.log.error('Error walking path %s', path, err);
180
+ }
106
181
  let resolvedCID = terminalElement?.cid ?? cid;
107
182
  let stat;
108
183
  if (terminalElement?.type === 'directory') {
@@ -110,7 +185,6 @@ export class VerifiedFetch {
110
185
  const rootFilePath = 'index.html';
111
186
  try {
112
187
  this.log.trace('found directory at %c/%s, looking for index.html', cid, path);
113
- options?.onProgress?.(new CustomProgressEvent('verified-fetch:request:start', { cid: dirCid, path: rootFilePath }));
114
188
  stat = await this.unixfs.stat(dirCid, {
115
189
  path: rootFilePath,
116
190
  signal: options?.signal,
@@ -123,33 +197,40 @@ export class VerifiedFetch {
123
197
  }
124
198
  catch (err) {
125
199
  this.log('error loading path %c/%s', dirCid, rootFilePath, err);
126
- return new Response('Unable to find index.html for directory at given path. Support for directories with implicit root is not implemented', { status: 501 });
200
+ return notSupportedResponse('Unable to find index.html for directory at given path. Support for directories with implicit root is not implemented');
127
201
  }
128
202
  finally {
129
203
  options?.onProgress?.(new CustomProgressEvent('verified-fetch:request:end', { cid: dirCid, path: rootFilePath }));
130
204
  }
131
205
  }
132
- options?.onProgress?.(new CustomProgressEvent('verified-fetch:request:start', { cid: resolvedCID, path: '' }));
133
206
  const asyncIter = this.unixfs.cat(resolvedCID, {
134
207
  signal: options?.signal,
135
208
  onProgress: options?.onProgress
136
209
  });
137
- options?.onProgress?.(new CustomProgressEvent('verified-fetch:request:end', { cid: resolvedCID, path: '' }));
138
210
  this.log('got async iterator for %c/%s', cid, path);
139
211
  const { stream, firstChunk } = await getStreamFromAsyncIterable(asyncIter, path ?? '', this.helia.logger, {
140
212
  onProgress: options?.onProgress
141
213
  });
142
- const response = new Response(stream, { status: 200 });
214
+ const response = okResponse(stream);
143
215
  await this.setContentType(firstChunk, path, response);
216
+ if (ipfsRoots != null) {
217
+ response.headers.set('X-Ipfs-Roots', ipfsRoots.map(cid => cid.toV1().toString()).join(',')); // https://specs.ipfs.tech/http-gateways/path-gateway/#x-ipfs-roots-response-header
218
+ }
144
219
  return response;
145
220
  }
146
221
  async handleRaw({ cid, path, options }) {
147
- this.log.trace('fetching %c/%s', cid, path);
148
- options?.onProgress?.(new CustomProgressEvent('verified-fetch:request:start', { cid, path }));
149
- const result = await this.helia.blockstore.get(cid);
150
- options?.onProgress?.(new CustomProgressEvent('verified-fetch:request:end', { cid, path }));
151
- const response = new Response(decode(result), { status: 200 });
152
- await this.setContentType(result, path, response);
222
+ const result = await this.helia.blockstore.get(cid, options);
223
+ const response = okResponse(result);
224
+ // if the user has specified an `Accept` header that corresponds to a raw
225
+ // type, honour that header, so for example they don't request
226
+ // `application/vnd.ipld.raw` but get `application/octet-stream`
227
+ const overriddenContentType = getOverridenRawContentType(options?.headers);
228
+ if (overriddenContentType != null) {
229
+ response.headers.set('content-type', overriddenContentType);
230
+ }
231
+ else {
232
+ await this.setContentType(result, path, response);
233
+ }
153
234
  return response;
154
235
  }
155
236
  async setContentType(bytes, path, response) {
@@ -176,98 +257,94 @@ export class VerifiedFetch {
176
257
  response.headers.set('content-type', contentType);
177
258
  }
178
259
  /**
179
- * Determines the format requested by the client, defaults to `null` if no format is requested.
180
- *
181
- * @see https://specs.ipfs.tech/http-gateways/path-gateway/#format-request-query-parameter
182
- * @default 'raw'
183
- */
184
- getFormat({ headerFormat, queryFormat }) {
185
- const formatMap = {
186
- 'vnd.ipld.raw': 'raw',
187
- 'vnd.ipld.car': 'car',
188
- 'application/x-tar': 'tar',
189
- 'application/vnd.ipld.dag-json': 'dag-json',
190
- 'application/vnd.ipld.dag-cbor': 'dag-cbor',
191
- 'application/json': 'json',
192
- 'application/cbor': 'cbor',
193
- 'vnd.ipfs.ipns-record': 'ipns-record'
194
- };
195
- if (headerFormat != null) {
196
- for (const format in formatMap) {
197
- if (headerFormat.includes(format)) {
198
- return formatMap[format];
199
- }
200
- }
201
- }
202
- else if (queryFormat != null) {
203
- return queryFormat;
204
- }
205
- return null;
206
- }
207
- /**
208
- * Map of format to specific handlers for that format.
209
- * These format handlers should adjust the response headers as specified in https://specs.ipfs.tech/http-gateways/path-gateway/#response-headers
260
+ * If the user has not specified an Accept header or format query string arg,
261
+ * use the CID codec to choose an appropriate handler for the block data.
210
262
  */
211
- formatHandlers = {
212
- raw: async () => new Response('application/vnd.ipld.raw support is not implemented', { status: 501 }),
213
- car: this.handleIPLDCar,
214
- 'ipns-record': this.handleIPNSRecord,
215
- tar: async () => new Response('application/x-tar support is not implemented', { status: 501 }),
216
- 'dag-json': async () => new Response('application/vnd.ipld.dag-json support is not implemented', { status: 501 }),
217
- 'dag-cbor': async () => new Response('application/vnd.ipld.dag-cbor support is not implemented', { status: 501 }),
218
- json: async () => new Response('application/json support is not implemented', { status: 501 }),
219
- cbor: async () => new Response('application/cbor support is not implemented', { status: 501 })
220
- };
221
263
  codecHandlers = {
222
- [dagJsonCode]: this.handleDagJson,
223
264
  [dagPbCode]: this.handleDagPb,
265
+ [ipldDagJson.code]: this.handleJson,
224
266
  [jsonCode]: this.handleJson,
225
- [dagCborCode]: this.handleDagCbor,
226
- [rawCode]: this.handleRaw
267
+ [ipldDagCbor.code]: this.handleDagCbor,
268
+ [rawCode]: this.handleRaw,
269
+ [identity.code]: this.handleRaw
227
270
  };
228
271
  async fetch(resource, opts) {
272
+ this.log('fetch %s', resource);
229
273
  const options = convertOptions(opts);
230
- const { path, query, ...rest } = await parseResource(resource, { ipns: this.ipns, logger: this.helia.logger }, options);
231
- const cid = rest.cid;
274
+ options?.onProgress?.(new CustomProgressEvent('verified-fetch:request:start', { resource }));
275
+ // resolve the CID/path from the requested resource
276
+ const { path, query, cid } = await parseResource(resource, { ipns: this.ipns, logger: this.helia.logger }, options);
277
+ options?.onProgress?.(new CustomProgressEvent('verified-fetch:request:resolve', { cid, path }));
278
+ const requestHeaders = new Headers(options?.headers);
279
+ const incomingAcceptHeader = requestHeaders.get('accept');
280
+ if (incomingAcceptHeader != null) {
281
+ this.log('incoming accept header "%s"', incomingAcceptHeader);
282
+ }
283
+ const queryFormatMapping = queryFormatToAcceptHeader(query.format);
284
+ if (query.format != null) {
285
+ this.log('incoming query format "%s", mapped to %s', query.format, queryFormatMapping);
286
+ }
287
+ const acceptHeader = incomingAcceptHeader ?? queryFormatMapping;
288
+ const accept = selectOutputType(cid, acceptHeader);
289
+ this.log('output type %s', accept);
290
+ if (acceptHeader != null && accept == null) {
291
+ return notAcceptableResponse();
292
+ }
232
293
  let response;
233
- const format = this.getFormat({ headerFormat: new Headers(options?.headers).get('accept'), queryFormat: query.format ?? null });
234
- if (format != null) {
235
- // TODO: These should be handled last when they're returning something other than 501
236
- const formatHandler = this.formatHandlers[format];
237
- if (formatHandler != null) {
238
- response = await formatHandler.call(this, { cid, path, options });
239
- if (response.status === 501) {
240
- return response;
241
- }
242
- }
294
+ let reqFormat;
295
+ if (accept === 'application/vnd.ipfs.ipns-record') {
296
+ // the user requested a raw IPNS record
297
+ reqFormat = 'ipns-record';
298
+ response = await this.handleIPNSRecord(resource.toString(), options);
243
299
  }
244
- let terminalElement;
245
- let ipfsRoots;
246
- try {
247
- const pathDetails = await this.pathWalker(this.helia.blockstore, `${cid.toString()}/${path}`, options);
248
- ipfsRoots = pathDetails.ipfsRoots;
249
- terminalElement = pathDetails.terminalElement;
300
+ else if (accept === 'application/vnd.ipld.car') {
301
+ // the user requested a CAR file
302
+ reqFormat = 'car';
303
+ query.download = true;
304
+ query.filename = query.filename ?? `${cid.toString()}.car`;
305
+ response = await this.handleCar({ cid, path, options });
250
306
  }
251
- catch (err) {
252
- this.log.error('Error walking path %s', path, err);
253
- // return new Response(`Error walking path: ${(err as Error).message}`, { status: 500 })
307
+ else if (accept === 'application/vnd.ipld.raw') {
308
+ // the user requested a raw block
309
+ reqFormat = 'raw';
310
+ query.download = true;
311
+ query.filename = query.filename ?? `${cid.toString()}.bin`;
312
+ response = await this.handleRaw({ cid, path, options });
313
+ }
314
+ else if (accept === 'application/x-tar') {
315
+ // the user requested a TAR file
316
+ reqFormat = 'tar';
317
+ response = await this.handleTar({ cid, path, options });
254
318
  }
255
- if (response == null) {
319
+ else {
320
+ // derive the handler from the CID type
256
321
  const codecHandler = this.codecHandlers[cid.code];
257
- if (codecHandler != null) {
258
- response = await codecHandler.call(this, { cid, path, options, terminalElement });
322
+ if (codecHandler == null) {
323
+ return notSupportedResponse(`Support for codec with code ${cid.code} is not yet implemented. Please open an issue at https://github.com/ipfs/helia/issues/new`);
259
324
  }
260
- else {
261
- return new Response(`Support for codec with code ${cid.code} is not yet implemented. Please open an issue at https://github.com/ipfs/helia/issues/new`, { status: 501 });
325
+ response = await codecHandler.call(this, { cid, path, accept, options });
326
+ }
327
+ response.headers.set('etag', getETag({ cid, reqFormat, weak: false }));
328
+ response.headers.set('cache-control', 'public, max-age=29030400, immutable');
329
+ // https://specs.ipfs.tech/http-gateways/path-gateway/#x-ipfs-path-response-header
330
+ response.headers.set('X-Ipfs-Path', resource.toString());
331
+ // set Content-Disposition header
332
+ let contentDisposition;
333
+ // force download if requested
334
+ if (query.download === true) {
335
+ contentDisposition = 'attachment';
336
+ }
337
+ // override filename if requested
338
+ if (query.filename != null) {
339
+ if (contentDisposition == null) {
340
+ contentDisposition = 'inline';
262
341
  }
342
+ contentDisposition = `${contentDisposition}; ${getContentDispositionFilename(query.filename)}`;
263
343
  }
264
- response.headers.set('etag', cid.toString()); // https://specs.ipfs.tech/http-gateways/path-gateway/#etag-response-header
265
- response.headers.set('cache-cotrol', 'public, max-age=29030400, immutable');
266
- response.headers.set('X-Ipfs-Path', resource.toString()); // https://specs.ipfs.tech/http-gateways/path-gateway/#x-ipfs-path-response-header
267
- if (ipfsRoots != null) {
268
- response.headers.set('X-Ipfs-Roots', ipfsRoots.map(cid => cid.toV1().toString()).join(',')); // https://specs.ipfs.tech/http-gateways/path-gateway/#x-ipfs-roots-response-header
344
+ if (contentDisposition != null) {
345
+ response.headers.set('Content-Disposition', contentDisposition);
269
346
  }
270
- // response.headers.set('Content-Disposition', `TODO`) // https://specs.ipfs.tech/http-gateways/path-gateway/#content-disposition-response-header
347
+ options?.onProgress?.(new CustomProgressEvent('verified-fetch:request:end', { cid, path }));
271
348
  return response;
272
349
  }
273
350
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"verified-fetch.js","sourceRoot":"","sources":["../../src/verified-fetch.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,IAAI,YAAY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,CAAC,KAAK;QACT,MAAM,IAAI,CAAC,KAAK,CAAC,KAAK,EAAE,CAAA;IAC1B,CAAC;IAED;;OAEG;IACH,KAAK,CAAC,IAAI;QACR,MAAM,IAAI,CAAC,KAAK,CAAC,IAAI,EAAE,CAAA;IACzB,CAAC;CACF;AAED,SAAS,SAAS,CAAM,CAAO;IAC7B,OAAO,CAAC,EAAE,IAAI,IAAI,IAAI,CAAA;AACxB,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@helia/verified-fetch",
3
- "version": "0.0.0-7a7c0c1",
3
+ "version": "0.0.0-7c3ce21",
4
4
  "description": "A fetch-like API for obtaining verified & trustless IPFS content on the web.",
5
5
  "license": "Apache-2.0 OR MIT",
6
6
  "homepage": "https://github.com/ipfs/helia/tree/main/packages/verified-fetch#readme",
@@ -141,33 +141,43 @@
141
141
  "release": "aegir release"
142
142
  },
143
143
  "dependencies": {
144
- "@helia/block-brokers": "2.0.1-7a7c0c1",
145
- "@helia/dag-cbor": "3.0.0-7a7c0c1",
146
- "@helia/dag-json": "3.0.0-7a7c0c1",
147
- "@helia/http": "1.0.1-7a7c0c1",
148
- "@helia/interface": "4.0.0-7a7c0c1",
149
- "@helia/ipns": "6.0.0-7a7c0c1",
150
- "@helia/json": "3.0.0-7a7c0c1",
151
- "@helia/routers": "1.0.0-7a7c0c1",
152
- "@helia/unixfs": "3.0.0-7a7c0c1",
153
- "@ipld/dag-cbor": "^9.1.0",
154
- "@ipld/dag-json": "^10.1.7",
155
- "@ipld/dag-pb": "^4.0.8",
144
+ "@helia/block-brokers": "2.0.1-7c3ce21",
145
+ "@helia/http": "1.0.1-7c3ce21",
146
+ "@helia/interface": "4.0.0-7c3ce21",
147
+ "@helia/ipns": "6.0.0-7c3ce21",
148
+ "@helia/routers": "1.0.0-7c3ce21",
149
+ "@helia/unixfs": "3.0.0-7c3ce21",
150
+ "@ipld/dag-cbor": "^9.2.0",
151
+ "@ipld/dag-json": "^10.2.0",
152
+ "@ipld/dag-pb": "^4.1.0",
156
153
  "@libp2p/interface": "^1.1.2",
157
154
  "@libp2p/peer-id": "^4.0.5",
155
+ "cborg": "^4.0.9",
158
156
  "hashlru": "^2.3.0",
159
157
  "ipfs-unixfs-exporter": "^13.5.0",
160
- "multiformats": "^13.0.1",
158
+ "multiformats": "^13.1.0",
161
159
  "progress-events": "^1.0.0"
162
160
  },
163
161
  "devDependencies": {
162
+ "@helia/car": "3.0.0-7c3ce21",
163
+ "@helia/dag-cbor": "3.0.0-7c3ce21",
164
+ "@helia/dag-json": "3.0.0-7c3ce21",
165
+ "@helia/json": "3.0.0-7c3ce21",
166
+ "@helia/utils": "0.0.1-7c3ce21",
167
+ "@ipld/car": "^5.2.6",
164
168
  "@libp2p/logger": "^4.0.5",
165
169
  "@libp2p/peer-id-factory": "^4.0.5",
166
170
  "@sgtpooki/file-type": "^1.0.1",
167
171
  "@types/sinon": "^17.0.3",
168
172
  "aegir": "^42.2.2",
169
- "helia": "4.0.1-7a7c0c1",
173
+ "blockstore-core": "^4.4.0",
174
+ "datastore-core": "^9.2.8",
175
+ "helia": "4.0.1-7c3ce21",
176
+ "ipns": "^9.0.0",
177
+ "it-last": "^3.0.4",
178
+ "it-to-buffer": "^4.0.5",
170
179
  "magic-bytes.js": "^1.8.0",
180
+ "p-defer": "^4.0.0",
171
181
  "sinon": "^17.0.1",
172
182
  "sinon-ts": "^2.0.0",
173
183
  "uint8arrays": "^5.0.1"