index: don't send git files

Signed-off-by: Sean Cross <sean@xobs.io>
This commit is contained in:
Sean Cross 2019-01-12 14:01:41 +08:00
parent 26c79d54e5
commit 80d21e9853

View File

@ -147,6 +147,9 @@ io.on('connection', (socket) => {
app.use(bodyParser.json()); // Parse application/json app.use(bodyParser.json()); // Parse application/json
app.use(bodyParser.urlencoded({ extended: true })); // Parse application/x-www-form-urlencoded app.use(bodyParser.urlencoded({ extended: true })); // Parse application/x-www-form-urlencoded
app.all(/\.git/, (req, res) => {
res.sendStatus(404);
});
app.post('/webhook', (req, res) => { return webhook(config, req, res); }); app.post('/webhook', (req, res) => { return webhook(config, req, res); });
app.get("/token", function(req,res) { app.get("/token", function(req,res) {
var ts = new Date().getTime(); var ts = new Date().getTime();