fix json validation

This commit is contained in:
Brian Seymour 2021-05-07 14:35:27 -05:00
parent de449c6d56
commit 5830d7fb43
2 changed files with 6 additions and 3 deletions

View File

@ -5,10 +5,10 @@ const config = require('../config');
const runtime = require('../runtime'); const runtime = require('../runtime');
const { Job } = require('../job'); const { Job } = require('../job');
const package = require('../package') const package = require('../package')
const logger = require('logplease').create('api/v1'); const logger = require('logplease').create('api/v2');
router.use((req, res, next) => { router.use((req, res, next) => {
if (!req.body) { if (!req.body || req.body === '') {
return next(); return next();
} }

View File

@ -4,7 +4,10 @@ const axios = require('axios').default;
const axios_instance = argv => { const axios_instance = argv => {
argv.axios = axios.create({ argv.axios = axios.create({
baseURL: argv['piston-url'] baseURL: argv['piston-url'],
headers: {
'Content-Type': 'application/json'
}
}); });
return argv; return argv;