Skip to content

Commit

Permalink
fix(web): fix url encoded not working
Browse files Browse the repository at this point in the history
  • Loading branch information
dsevillamartin committed Aug 23, 2017
1 parent 7199de8 commit 4822eb9
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion lib/Web.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,21 @@ const ip = process.env.YAPPY_GITLAB_IP || process.env.OPENSHIFT_NODEJS_IP || pro

app.set('view engine', 'hbs');

app.use(bodyParser.urlencoded({
extended: true,
limit: '250kb',
}));

app.use(bodyParser.json({
limit: '250kb',
}));

// app.use(cookieParser());
app.use((req, res, next) => {
if (req.headers['content-type'] === 'application/x-www-form-urlencoded' && req.body && req.body.payload) {
req.body = JSON.parse(req.body.payload);
}
next();
});

app.get('/', (req, res) => {
const repos = new Set(ChannelConfig._data.reduce((a, b) => a.concat(b.repos), []));
Expand Down

0 comments on commit 4822eb9

Please sign in to comment.