From 8b883310654061a68bff3bc29632c0c963652b5b Mon Sep 17 00:00:00 2001 From: Karol Wypchlo Date: Wed, 16 Sep 2020 17:06:09 +0200 Subject: [PATCH] drop 404 not found on hnsres error --- docker/nginx/conf.d/client.conf | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/docker/nginx/conf.d/client.conf b/docker/nginx/conf.d/client.conf index fa047b70..34b9dafb 100644 --- a/docker/nginx/conf.d/client.conf +++ b/docker/nginx/conf.d/client.conf @@ -138,6 +138,11 @@ server { local json = require('cjson') local hns_domain_name, request_uri_rest = string.match(ngx.var.request_uri, "/hns/([^/?]+)(.*)") local hnsres_res = ngx.location.capture("/hnsres/" .. hns_domain_name) + + if hnsres_res.status ~= ngx.HTTP_OK then + ngx.exit(ngx.HTTP_NOT_FOUND) + end + local hnsres_json = json.decode(hnsres_res.body) local skylink_prefix, skylink, skylink_rest = string.match(hnsres_json.skylink, "(sia://)([^/?]+)(.*)")