X-Git-Url: http://git.squeep.com/?p=urlittler;a=blobdiff_plain;f=src%2Fservice.js;h=97ed85e6e9e678fbae45cd0512135eb749930f9c;hp=1b09d2daf104a22426dc2fbd10f422d1f4f3094f;hb=HEAD;hpb=254ea2414f0539d2ada998bb35778f4d031745ea diff --git a/src/service.js b/src/service.js index 1b09d2d..97ed85e 100644 --- a/src/service.js +++ b/src/service.js @@ -68,13 +68,13 @@ class Service extends Dingus { * @param {string} contentType * @param {object} ctx */ - parseBody(contentType, ctx) { + parseBody(contentType, ctx, rawBody) { // eslint-disable-next-line sonarjs/no-small-switch switch (contentType) { // Handle any additional content types here default: - super.parseBody(contentType, ctx); + super.parseBody(contentType, ctx, rawBody); } } @@ -107,10 +107,12 @@ class Service extends Dingus { */ async handlerPostRoot(req, res, ctx) { const _scope = _fileScope('handlerPostRoot'); - this.logger.debug(_scope, 'called', { req: common.requestLogData(req), ctx }); + this.logger.debug(_scope, 'called', { req, ctx }); this.setResponseType(this.responseTypes, req, res, ctx); - await this.ingestBody(req, res, ctx); + await this.ingestBody(req, res, ctx, { + maximumBodySize: 1024 * 8, + }); await this._postRootAuth(req, res, ctx); await this.manager.postRoot(res, ctx); @@ -127,7 +129,7 @@ class Service extends Dingus { const responseTypes = [ Enum.ContentType.TextHTML, ]; - this.logger.debug(_scope, 'called', { req: common.requestLogData(req), ctx }); + this.logger.debug(_scope, 'called', { req, ctx }); Dingus.setHeadHandler(req, res, ctx); @@ -146,7 +148,7 @@ class Service extends Dingus { */ async handlerGetId(req, res, ctx) { const _scope = _fileScope('handlerGetId'); - this.logger.debug(_scope, 'called', { req: common.requestLogData(req), ctx }); + this.logger.debug(_scope, 'called', { req, ctx }); Dingus.setHeadHandler(req, res, ctx); @@ -172,7 +174,7 @@ class Service extends Dingus { */ async handlerDeleteId(req, res, ctx) { const _scope = _fileScope('handlerDeleteId'); - this.logger.debug(_scope, 'called', { req: common.requestLogData(req), ctx }); + this.logger.debug(_scope, 'called', { req, ctx }); this.setResponseType(this.responseTypes, req, res, ctx); await this.authenticator.required(req, res, ctx); @@ -188,7 +190,7 @@ class Service extends Dingus { */ async handlerPutId(req, res, ctx) { const _scope = _fileScope('handlerPutId'); - this.logger.debug(_scope, 'called', { req: common.requestLogData(req), ctx }); + this.logger.debug(_scope, 'called', { req, ctx }); this.setResponseType(this.responseTypes, req, res, ctx); await this.ingestBody(req, res, ctx); @@ -205,7 +207,7 @@ class Service extends Dingus { */ async handlerGetIdInfo(req, res, ctx) { const _scope = _fileScope('handlerGetIdInfo'); - this.logger.debug(_scope, 'called', { req: common.requestLogData(req), ctx }); + this.logger.debug(_scope, 'called', { req, ctx }); Dingus.setHeadHandler(req, res, ctx); @@ -223,7 +225,7 @@ class Service extends Dingus { */ async handlerGetStatic(req, res, ctx) { const _scope = _fileScope('handlerGetStatic'); - this.logger.debug(_scope, 'called', { req: common.requestLogData(req), ctx }); + this.logger.debug(_scope, 'called', { req, ctx }); Dingus.setHeadHandler(req, res, ctx); @@ -242,7 +244,7 @@ class Service extends Dingus { */ async handlerGetAdminReport(req, res, ctx) { const _scope = _fileScope('handlerAdminReport'); - this.logger.debug(_scope, 'called', { req: common.requestLogData(req), ctx }); + this.logger.debug(_scope, 'called', { req, ctx }); Dingus.setHeadHandler(req, res, ctx);