added token

This commit is contained in:
Flummi 2016-09-10 18:26:03 +02:00
parent 465b843016
commit 395ebbe9f8

View File

@ -23,7 +23,7 @@ function Websrv(tbot, tsql, tlib) {
if(filePath == './') if(filePath == './')
filePath = './index.html'; filePath = './index.html';
if(req.method == 'POST') { if(req.method == 'POST') {
if(filePath == './git') { if(filePath == './git' && req.headers['x-gitlab-token'] == cfg.gittoken) {
var body = ''; var body = '';
req.on('data', (data) => { req.on('data', (data) => {
body += data; body += data;
@ -40,6 +40,9 @@ function Websrv(tbot, tsql, tlib) {
res.writeHead(200, { 'Content-Type': 'text/html' }); res.writeHead(200, { 'Content-Type': 'text/html' });
res.end('muh', 'utf-8'); res.end('muh', 'utf-8');
} }
else {
res.writeHead(403);
}
} }
else { else {
var extname = String(path.extname(filePath)).toLowerCase(); var extname = String(path.extname(filePath)).toLowerCase();