From 203ff0fd849e0d5d7f071ea9ef5acf57dfe51835 Mon Sep 17 00:00:00 2001 From: Karol Wypchlo Date: Wed, 27 Jan 2021 13:39:00 +0100 Subject: [PATCH] ensure skylink_rest is local --- docker/nginx/conf.d/client.conf | 3 +++ 1 file changed, 3 insertions(+) diff --git a/docker/nginx/conf.d/client.conf b/docker/nginx/conf.d/client.conf index 276b8872..8376067d 100644 --- a/docker/nginx/conf.d/client.conf +++ b/docker/nginx/conf.d/client.conf @@ -176,6 +176,9 @@ server { -- example response: '{"skylink":"sia://XABvi7JtJbQSMAcDwnUnmp2FKDPjg8_tTTFP4BwMSxVdEg"}' 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 -- try to match the skylink with sia:// prefix skylink, skylink_rest = string.match(hnsres_json.skylink, "sia://([^/?]+)(.*)")