From 651935ea3aa545e71dd508a58a7287d0564905b0 Mon Sep 17 00:00:00 2001 From: Ivaylo Novakov Date: Wed, 5 Aug 2020 17:20:29 +0300 Subject: [PATCH] Bring back the support for bare skylinks. --- handshake-api/index.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/handshake-api/index.js b/handshake-api/index.js index 24f7347a..896514fb 100644 --- a/handshake-api/index.js +++ b/handshake-api/index.js @@ -19,7 +19,8 @@ const clientOptions = { }; const client = new NodeClient(clientOptions); -const startsWithSkylinkRegExp = /^sia:\/\/[a-zA-Z0-9_-]{46}/; +// Match both `sia://HASH` and `HASH` links. +const startsWithSkylinkRegExp = /^(sia:\/\/){0,1}[a-zA-Z0-9_-]{46}/; const getDomainRecords = async (name) => { const response = await client.execute("getnameresource", [name]);