(res: HttpResponse)
| 264 | } |
| 265 | |
| 266 | events(res: HttpResponse) { |
| 267 | this.attachMiddleware(res, [ |
| 268 | this.corkMiddleware, |
| 269 | this.jsonBodyMiddleware, |
| 270 | this.corsMiddleware, |
| 271 | this.appMiddleware, |
| 272 | this.authMiddleware, |
| 273 | this.broadcastEventRateLimitingMiddleware, |
| 274 | ]).then(res => { |
| 275 | this.checkMessageToBroadcast(res.body as PusherApiMessage, res.app as App).then(message => { |
| 276 | this.broadcastMessage(message, res.app.id); |
| 277 | this.server.metricsManager.markApiMessage(res.app.id, res.body, { ok: true }); |
| 278 | this.sendJson(res, { ok: true }); |
| 279 | }).catch(error => { |
| 280 | if (error.code === 400) { |
| 281 | this.badResponse(res, error.message); |
| 282 | } else if (error.code === 413) { |
| 283 | this.entityTooLargeResponse(res, error.message); |
| 284 | } |
| 285 | }); |
| 286 | }); |
| 287 | } |
| 288 | |
| 289 | batchEvents(res: HttpResponse) { |
| 290 | this.attachMiddleware(res, [ |
no test coverage detected