From 6076e36a08ad59db9a0cee01e3956fe4910344e0 Mon Sep 17 00:00:00 2001 From: Alessandro Ranellucci Date: Mon, 3 Jun 2024 12:40:23 +0200 Subject: [PATCH] Support non-HTTPS metadata download. Fixes #280 --- spid-validator/server/lib/utils.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/spid-validator/server/lib/utils.js b/spid-validator/server/lib/utils.js index bdf3901..48109a6 100644 --- a/spid-validator/server/lib/utils.js +++ b/spid-validator/server/lib/utils.js @@ -64,7 +64,9 @@ class Utils { } // check if URL exists - https.get(src, (res) => { + var q = url.parse(src, true); + var protocol = (q.protocol == "http:") ? require('http') : require('https'); + protocol.get(src, (res) => { if(res.statusCode!='200') { return reject("Metadata non trovato alla URL indicata"); }