ensure skylink_rest is local
This commit is contained in:
parent
5576c223ce
commit
203ff0fd84
|
@ -176,6 +176,9 @@ server {
|
||||||
-- example response: '{"skylink":"sia://XABvi7JtJbQSMAcDwnUnmp2FKDPjg8_tTTFP4BwMSxVdEg"}'
|
-- example response: '{"skylink":"sia://XABvi7JtJbQSMAcDwnUnmp2FKDPjg8_tTTFP4BwMSxVdEg"}'
|
||||||
local hnsres_json = json.decode(hnsres_res.body)
|
local hnsres_json = json.decode(hnsres_res.body)
|
||||||
|
|
||||||
|
-- define local variable containing rest of the skylink if provided
|
||||||
|
local skylink_rest
|
||||||
|
|
||||||
if hnsres_json.skylink then
|
if hnsres_json.skylink then
|
||||||
-- try to match the skylink with sia:// prefix
|
-- try to match the skylink with sia:// prefix
|
||||||
skylink, skylink_rest = string.match(hnsres_json.skylink, "sia://([^/?]+)(.*)")
|
skylink, skylink_rest = string.match(hnsres_json.skylink, "sia://([^/?]+)(.*)")
|
||||||
|
|
Reference in New Issue