application/json payload support

dependabot/npm_and_yarn/BuildServer/eslint-7.2.0
Inga 🏳‍🌈 10 years ago
parent c8e87dc97f
commit 08ea617ae9
  1. 6
      BuildServer/routes/postreceive.js

@ -5,11 +5,11 @@ var builder = require('../lib/builder');
*/ */
module.exports = function (req, res) { module.exports = function (req, res) {
if (!req.body || !req.body.payload) { if (!req.body || (!req.body.payload && !req.body.repository)) {
res.end(); return res.end();
} }
var payload = JSON.parse(req.body.payload), var payload = req.body.payload ? JSON.parse(req.body.payload) : req.body,
repository = payload.repository; repository = payload.repository;
builder.build({ builder.build({

Loading…
Cancel
Save