From 6f28c6ef792cd8d34f40f9a8016dc2233940d058 Mon Sep 17 00:00:00 2001 From: Karol Wypchlo Date: Wed, 29 Sep 2021 19:31:08 +0200 Subject: [PATCH] debug --- packages/ipfs-api/src/utils.ts | 3 +++ 1 file changed, 3 insertions(+) diff --git a/packages/ipfs-api/src/utils.ts b/packages/ipfs-api/src/utils.ts index 377ba376..7f9ec1a4 100644 --- a/packages/ipfs-api/src/utils.ts +++ b/packages/ipfs-api/src/utils.ts @@ -8,12 +8,14 @@ const client = new SkynetClient(SKYNET_PORTAL); export async function contentType(cid: string): Promise { const url = `${IPFS_GATEWAY}/${cid}`; + console.log(`got(HEAD): ${url}`); const response = await got.head(url); return response.headers["content-type"]; } export async function isDirectory(cid: string): Promise { const url = `${IPFS_INFURA_API}/api/v0/object/get?arg=${cid}&encoding=json`; + console.log(`got(GET): ${url}`); const json = await got.get(url).json(); return Boolean(json["Links"].length); } @@ -30,6 +32,7 @@ export async function download( console.log(url); return new Promise((resolve, reject) => { + console.log(`got(STREAM): ${url}`); const downloadStream = got.stream(url); downloadStream.on("error", (error) => { console.error(`Download failed: ${error.message}`);