Support only `sia://HASH` skylinks.

This commit is contained in:
Ivaylo Novakov 2020-08-05 14:47:15 +03:00
parent 4e37707a07
commit 2b31f6c34a
No known key found for this signature in database
GPG Key ID: 06B9354AB08BE9C6
1 changed files with 1 additions and 2 deletions

View File

@ -19,8 +19,7 @@ const clientOptions = {
}; };
const client = new NodeClient(clientOptions); const client = new NodeClient(clientOptions);
// Match both `sia://HASH` and `HASH` links. const startsWithSkylinkRegExp = /^sia:\/\/[a-zA-Z0-9_-]{46}/;
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]);