diff --git a/package-lock.json b/package-lock.json index 26a098a..b455bcf 100644 --- a/package-lock.json +++ b/package-lock.json @@ -12,15 +12,15 @@ "dependencies": { "@chainsafe/libp2p-noise": "^15.0.0", "@chainsafe/libp2p-yamux": "^6.0.2", - "@fastify/compress": "^7.0.0", + "@fastify/compress": "^7.0.1", "@fastify/cors": "^9.0.1", - "@helia/block-brokers": "^2.0.2", + "@helia/block-brokers": "^2.0.3", "@helia/delegated-routing-v1-http-api-client": "^3.0.0", "@helia/http": "^1.0.3", - "@helia/interface": "^4.0.1", - "@helia/routers": "^1.0.1", + "@helia/interface": "^4.1.0", + "@helia/routers": "^1.0.2", "@helia/utils": "^0.1.0", - "@helia/verified-fetch": "^1.1.2", + "@helia/verified-fetch": "^1.3.2", "@libp2p/bootstrap": "^10.0.16", "@libp2p/circuit-relay-v2": "^1.0.16", "@libp2p/identify": "^1.0.15", @@ -32,9 +32,9 @@ "@libp2p/prometheus-metrics": "^3.0.16", "@libp2p/tcp": "^9.0.16", "@libp2p/tls": "^1.0.2", - "@libp2p/webrtc": "^4.0.20", + "@libp2p/webrtc": "^4.0.22", "@libp2p/websockets": "^8.0.16", - "@multiformats/multiaddr": "^12.2.0", + "@multiformats/multiaddr": "^12.2.1", "@sgtpooki/file-type": "^1.0.1", "blockstore-level": "^1.1.8", "datastore-level": "^10.1.7", @@ -42,25 +42,25 @@ "fastify-metrics": "^11.0.0", "helia": "^4.1.0", "ipns": "^9.0.0", - "libp2p": "^1.2.4", - "multiformats": "^13.0.1", - "pino-pretty": "^10.3.1", + "libp2p": "^1.3.0", + "multiformats": "^13.1.0", + "pino-pretty": "^11.0.0", "private-ip": "^3.0.2" }, "devDependencies": { - "@playwright/test": "^1.40.1", - "@types/node": "^20.11.25", + "@playwright/test": "^1.42.1", + "@types/node": "^20.11.30", "aegir": "^42.2.5", "clinic": "^13.0.0", "concurrently": "^8.2.2", "cross-env": "^7.0.3", "debug": "^4.3.4", - "dotenv": "^16.3.1", + "dotenv": "^16.4.5", "execa": "^8.0.1", "glob": "^10.3.10", "patch-package": "^8.0.0", "typescript": "5.x", - "wait-on": "^7.1.0" + "wait-on": "^7.2.0" } }, "node_modules/@aashutoshrathi/word-wrap": { @@ -3346,9 +3346,9 @@ } }, "node_modules/@fastify/compress": { - "version": "7.0.0", - "resolved": "https://registry.npmjs.org/@fastify/compress/-/compress-7.0.0.tgz", - "integrity": "sha512-jo/NaBVHP1OXIf8Kmr3bZyYQB0gAIgcy5c8rRKTPjhklHO7lRs/6ZFckUVT0NtbKSvrTuIcmSkxYpjyv3FNHXA==", + "version": "7.0.1", + "resolved": "https://registry.npmjs.org/@fastify/compress/-/compress-7.0.1.tgz", + "integrity": "sha512-Vj7DyXxdVRJD84Z/MxFz+lBWnFL1y892grSw8tdBFKZiPY+oM1LqjTjLzgwVqkviNhUsiE4xxVtiRDz6IrnL6w==", "dependencies": { "@fastify/accept-negotiator": "^1.1.0", "fastify-plugin": "^4.5.0", @@ -3571,9 +3571,9 @@ } }, "node_modules/@helia/verified-fetch": { - "version": "1.1.3", - "resolved": "https://registry.npmjs.org/@helia/verified-fetch/-/verified-fetch-1.1.3.tgz", - "integrity": "sha512-40NxYCdkjpHtaL2WnmwLqQFYFtC0zZBboUx/qaT284ZBYqT3x4lG0gISL9zlKjkEMhaCgyGeDYiPaQOQJ0fhYg==", + "version": "1.3.2", + "resolved": "https://registry.npmjs.org/@helia/verified-fetch/-/verified-fetch-1.3.2.tgz", + "integrity": "sha512-JE9nYJYNC/R670P7ZJ938EL6Kfq4eCOb0YlyzvCQkXicruS0dGahKScSbayRCQmuSGe62n/OtM6n94o4Uq9BxA==", "dependencies": { "@helia/block-brokers": "^2.0.2", "@helia/car": "^3.1.0", @@ -7294,9 +7294,9 @@ } }, "node_modules/@types/node": { - "version": "20.11.28", - "resolved": "https://registry.npmjs.org/@types/node/-/node-20.11.28.tgz", - "integrity": "sha512-M/GPWVS2wLkSkNHVeLkrF2fD5Lx5UC4PxA0uZcKc6QqbIQUJyW1jVjueJYi1z8n0I5PxYrtpnPnWglE+y9A0KA==", + "version": "20.11.30", + "resolved": "https://registry.npmjs.org/@types/node/-/node-20.11.30.tgz", + "integrity": "sha512-dHM6ZxwlmuZaRmUPfv1p+KrdD1Dci04FbdEm/9wEMouFqxYoFl5aMkt0VMAUtYRQDyYvD41WJLukhq/ha3YuTw==", "dependencies": { "undici-types": "~5.26.4" } @@ -26976,9 +26976,9 @@ } }, "node_modules/pino-pretty": { - "version": "10.3.1", - "resolved": "https://registry.npmjs.org/pino-pretty/-/pino-pretty-10.3.1.tgz", - "integrity": "sha512-az8JbIYeN/1iLj2t0jR9DV48/LQ3RC6hZPpapKPkb84Q+yTidMCpgWxIT3N0flnBDilyBQ1luWNpOeJptjdp/g==", + "version": "11.0.0", + "resolved": "https://registry.npmjs.org/pino-pretty/-/pino-pretty-11.0.0.tgz", + "integrity": "sha512-YFJZqw59mHIY72wBnBs7XhLGG6qpJMa4pEQTRgEPEbjIYbng2LXEZZF1DoyDg9CfejEy8uZCyzpcBXXG0oOCwQ==", "dependencies": { "colorette": "^2.0.7", "dateformat": "^4.6.3", diff --git a/package.json b/package.json index 7b171e0..3ed6d18 100644 --- a/package.json +++ b/package.json @@ -75,15 +75,15 @@ "dependencies": { "@chainsafe/libp2p-noise": "^15.0.0", "@chainsafe/libp2p-yamux": "^6.0.2", - "@fastify/compress": "^7.0.0", + "@fastify/compress": "^7.0.1", "@fastify/cors": "^9.0.1", - "@helia/block-brokers": "^2.0.2", + "@helia/block-brokers": "^2.0.3", "@helia/delegated-routing-v1-http-api-client": "^3.0.0", "@helia/http": "^1.0.3", - "@helia/interface": "^4.0.1", - "@helia/routers": "^1.0.1", + "@helia/interface": "^4.1.0", + "@helia/routers": "^1.0.2", "@helia/utils": "^0.1.0", - "@helia/verified-fetch": "^1.1.2", + "@helia/verified-fetch": "^1.3.2", "@libp2p/bootstrap": "^10.0.16", "@libp2p/circuit-relay-v2": "^1.0.16", "@libp2p/identify": "^1.0.15", @@ -95,9 +95,9 @@ "@libp2p/prometheus-metrics": "^3.0.16", "@libp2p/tcp": "^9.0.16", "@libp2p/tls": "^1.0.2", - "@libp2p/webrtc": "^4.0.20", + "@libp2p/webrtc": "^4.0.22", "@libp2p/websockets": "^8.0.16", - "@multiformats/multiaddr": "^12.2.0", + "@multiformats/multiaddr": "^12.2.1", "@sgtpooki/file-type": "^1.0.1", "blockstore-level": "^1.1.8", "datastore-level": "^10.1.7", @@ -105,24 +105,24 @@ "fastify-metrics": "^11.0.0", "helia": "^4.1.0", "ipns": "^9.0.0", - "libp2p": "^1.2.4", - "multiformats": "^13.0.1", - "pino-pretty": "^10.3.1", + "libp2p": "^1.3.0", + "multiformats": "^13.1.0", + "pino-pretty": "^11.0.0", "private-ip": "^3.0.2" }, "devDependencies": { - "@playwright/test": "^1.40.1", - "@types/node": "^20.11.25", + "@playwright/test": "^1.42.1", + "@types/node": "^20.11.30", "aegir": "^42.2.5", "clinic": "^13.0.0", "concurrently": "^8.2.2", "cross-env": "^7.0.3", "debug": "^4.3.4", - "dotenv": "^16.3.1", + "dotenv": "^16.4.5", "execa": "^8.0.1", "glob": "^10.3.10", "patch-package": "^8.0.0", "typescript": "5.x", - "wait-on": "^7.1.0" + "wait-on": "^7.2.0" } } diff --git a/src/helia-server.ts b/src/helia-server.ts index 8c7acd5..8b7ef77 100644 --- a/src/helia-server.ts +++ b/src/helia-server.ts @@ -173,7 +173,7 @@ export class HeliaServer { encodedDnsLink = dnsLinkLabelEncoder(address) } - const finalUrl = `//${cidv1Address ?? encodedDnsLink}.${namespace}.${request.hostname}/${relativePath ?? ''}` + const finalUrl = `${request.protocol}://${cidv1Address ?? encodedDnsLink}.${namespace}.${request.hostname}/${relativePath ?? ''}` this.log('redirecting to final URL:', finalUrl) await reply .headers({ @@ -213,6 +213,7 @@ export class HeliaServer { return } if (verifiedFetchResponse.body == null) { + // this should never happen this.log('verified-fetch response has no body') await reply.code(501).send('empty') return diff --git a/src/index.ts b/src/index.ts index 8fe79ab..0b37afc 100644 --- a/src/index.ts +++ b/src/index.ts @@ -39,7 +39,7 @@ * * ## Run without Docker * - * ### Build + * ### Build * * ```sh * $ npm run build