adjust for sia:// prefixed skylinks

This commit is contained in:
Karol Wypchlo 2020-08-17 12:16:34 +02:00
parent a7ed72fb1d
commit 2ba0159289
1 changed files with 1 additions and 1 deletions

View File

@ -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