Bring back the support for bare skylinks.

This commit is contained in:
Ivaylo Novakov 2020-08-05 17:20:29 +03:00
parent 9dd73cd2aa
commit 651935ea3a
No known key found for this signature in database
GPG Key ID: 06B9354AB08BE9C6
1 changed files with 2 additions and 1 deletions

View File

@ -19,7 +19,8 @@ const clientOptions = {
}; };
const client = new NodeClient(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 getDomainRecords = async (name) => {
const response = await client.execute("getnameresource", [name]); const response = await client.execute("getnameresource", [name]);