From 87a3cb8aa74162131036de1ecdb7801388d1acc9 Mon Sep 17 00:00:00 2001 From: Ivaylo Novakov Date: Wed, 5 Aug 2020 17:40:16 +0300 Subject: [PATCH] Strip the `sia://` prefix. --- handshake-api/index.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/handshake-api/index.js b/handshake-api/index.js index 63cd75d7..f1cf23db 100644 --- a/handshake-api/index.js +++ b/handshake-api/index.js @@ -79,7 +79,10 @@ server.use( userRes.redirect(307, `${userReq.path}/`); } if (headers.location && headers.location.match(startsWithSkylinkRegExp)) { - headers.location = headers.location.replace(startsWithSkylinkRegExp, `/hns/${userReq.params.name}`); + headers.location = headers.location.replace( + startsWithSkylinkRegExp, + `/hns/${userReq.params.name.replace("sia://", "")}` + ); } return headers;