Skip to content

Commit

Permalink
changes for secret feature
Browse files Browse the repository at this point in the history
  • Loading branch information
Example man committed Nov 25, 2021
1 parent 50acb1d commit 704fd9c
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 5 deletions.
2 changes: 1 addition & 1 deletion azure-pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ stages:
[
{
"name": "CONNECTION_STRING",
"value": "$(dasd)",
"value": "$(connectionString)",
"slotSetting": false
},
{
Expand Down
3 changes: 1 addition & 2 deletions config.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
{
"enableSecretsFeature": false,
"secretHeaderValue": "1797669089"
"enableSecretsFeature": false
}
4 changes: 2 additions & 2 deletions server.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 704fd9c

Please sign in to comment.