mirror of
https://github.com/engineer-man/piston.git
synced 2025-05-05 11:26:27 +02:00
fix json validation
This commit is contained in:
parent
de449c6d56
commit
5830d7fb43
2 changed files with 6 additions and 3 deletions
|
@ -5,10 +5,10 @@ const config = require('../config');
|
|||
const runtime = require('../runtime');
|
||||
const { Job } = require('../job');
|
||||
const package = require('../package')
|
||||
const logger = require('logplease').create('api/v1');
|
||||
const logger = require('logplease').create('api/v2');
|
||||
|
||||
router.use((req, res, next) => {
|
||||
if (!req.body) {
|
||||
if (!req.body || req.body === '') {
|
||||
return next();
|
||||
}
|
||||
|
||||
|
|
|
@ -4,7 +4,10 @@ const axios = require('axios').default;
|
|||
|
||||
const axios_instance = argv => {
|
||||
argv.axios = axios.create({
|
||||
baseURL: argv['piston-url']
|
||||
baseURL: argv['piston-url'],
|
||||
headers: {
|
||||
'Content-Type': 'application/json'
|
||||
}
|
||||
});
|
||||
|
||||
return argv;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue