Skip to content

Commit

Permalink
fix request entity too large
Browse files Browse the repository at this point in the history
set express post limit to 100mb
  • Loading branch information
xuduo committed Aug 31, 2017
1 parent b61ab19 commit 96882ec
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 4 deletions.
7 changes: 5 additions & 2 deletions push-server/lib/api/restApi.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,12 @@ class RestApi {
app.disable('etag');

app.use("/api", bodyParser.urlencoded({ // to support URL-encoded bodies
extended: true
extended: true,
limit: '100mb'
}));
app.use("/api", bodyParser.json({
limit: '100mb'
}));
app.use("/api", bodyParser.json());
app.use("/api", (req, res, next) => {
res.set("Access-Control-Allow-Origin", "*");
stats.addApiCall(req.path);
Expand Down
2 changes: 1 addition & 1 deletion push-server/lib/stats/arrivalStats.js
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ class ArrivalStats {
}

addPushMany(msg, ttl, sentCount) {
logger.info('addPushMany, packet: %s', msg);
logger.debug('addPushMany, packet: ', msg);
const data = this.msgToData(msg, ttl);
data.type = 'pushMany';
this.addArrivalInfo(msg.id, {
Expand Down
2 changes: 1 addition & 1 deletion push-server/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "socket.io-push",
"version": "0.8.96",
"version": "0.8.97",
"description": "socket.io-push server by xuduo",
"main": "index.js",
"bin": {
Expand Down

0 comments on commit 96882ec

Please sign in to comment.