From 2ba0159289adac8639a3ef6146be5f56aa64850d Mon Sep 17 00:00:00 2001 From: Karol Wypchlo Date: Mon, 17 Aug 2020 12:16:34 +0200 Subject: [PATCH] adjust for sia:// prefixed skylinks --- handshake-api/index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/handshake-api/index.js b/handshake-api/index.js index 87b5a09a..6c057ca1 100644 --- a/handshake-api/index.js +++ b/handshake-api/index.js @@ -91,7 +91,7 @@ server.use( const record = findSkylinkRecord(records); if (!record) throw new Error(`No skylink found in dns records of ${req.params.name}`); - const skylink = getSkylinkFromRecord(record); + const skylink = getSkylinkFromRecord(record).replace("sia://", ""); // get skylink and strip sia:// prefix const basepath = url.resolve("/", skylink); // make the url absolute const subpath = req.url.slice(1); // drop the leading slash