Skip to content

Commit

Permalink
hotfix for issues with urlencoded request bodies
Browse files Browse the repository at this point in the history
  • Loading branch information
jdweeks committed Feb 6, 2019
1 parent 06d8113 commit 49039fe
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 5 deletions.
8 changes: 4 additions & 4 deletions app.js
Expand Up @@ -16,9 +16,9 @@ const bodyParser = require('body-parser');
const mongoose = require('mongoose');
const helmet = require('helmet');
const actuator = require('express-actuator');
var schedule = require('node-schedule');
const schedule = require('node-schedule');
const Archive = require('./models/common/Archive');
var constants = require('./lib/util/constants');
const constants = require('./lib/util/constants');

// connect to database
const db = require('./models/db');
Expand Down Expand Up @@ -48,9 +48,9 @@ function init() {
});

// parse request body based on content-type
app.use(bodyParser.text({ limit: '5mb', type: [ 'application/soap+xml', 'application/xml', 'text/xml', 'text/plain' ]}));
app.use(bodyParser.text({ limit: '5mb', type: [ 'application/x-www-form-urlencoded', 'application/soap+xml', 'application/xml', 'text/xml', 'text/plain' ]}));
app.use(bodyParser.json({ limit: '5mb', type: [ 'application/json' ]}));
app.use(bodyParser.urlencoded({ extended: false }));
//app.use(bodyParser.urlencoded({ extended: false }));

// expose health info
app.use(actuator('/api/admin'));
Expand Down
9 changes: 8 additions & 1 deletion winston.js
Expand Up @@ -23,6 +23,13 @@ if (process.env.MOCKIATO_SPLUNK_ENABLED) {
transports.push(new SplunkStreamEvent({ splunk: splunkSettings }));
}

logger = winston.createLogger({ transports: transports });
logger = winston.createLogger({
transports: transports,
format: winston.format.combine(
winston.format.colorize(),
winston.format.timestamp(),
winston.format.json()
),
});

module.exports = logger;

0 comments on commit 49039fe

Please sign in to comment.