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