From 704fd9ce21a12b2da6fd78b0c9ee84d899dafbf4 Mon Sep 17 00:00:00 2001 From: Example man Date: Thu, 25 Nov 2021 12:08:23 +0530 Subject: [PATCH] changes for secret feature --- azure-pipelines.yml | 2 +- config.json | 3 +-- server.js | 4 ++-- 3 files changed, 4 insertions(+), 5 deletions(-) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 418d1384..5c086ffa 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -83,7 +83,7 @@ stages: [ { "name": "CONNECTION_STRING", - "value": "$(dasd)", + "value": "$(connectionString)", "slotSetting": false }, { diff --git a/config.json b/config.json index 5a9d8ecf..65f89719 100644 --- a/config.json +++ b/config.json @@ -1,4 +1,3 @@ { - "enableSecretsFeature": false, - "secretHeaderValue": "1797669089" + "enableSecretsFeature": false } diff --git a/server.js b/server.js index 1412653b..d42b1be0 100644 --- a/server.js +++ b/server.js @@ -17,8 +17,8 @@ var server = http.createServer(function (req, res) { if(!reqUrl || (!!reqUrl && (reqUrl == "" || reqUrl.toLowerCase() == "index.html"))){ if(config.enableSecretsFeature) { console.log(req.headers['x-secret']); - console.log(config.secretHeaderValue); - if(req.headers['x-secret'] != config.secretHeaderValue) { + console.log(process.env.HEADER_VALUE); + if(req.headers['x-secret'] != process.env.HEADER_VALUE) { res.writeHead(401, "Unauthorized"); res.end(); return;