Skip to content

Commit

Permalink
fix: deprecation warning (#39)
Browse files Browse the repository at this point in the history
* Fix FastifyDeprecation warning of request.context usage

* fix: remove deprecation

* fix: coverage

Co-authored-by: Dusan K <duki994@gmail.com>
  • Loading branch information
Eomm and duki994 committed Nov 22, 2022
1 parent 4555a47 commit bb650d2
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
"homepage": "https://github.com/Eomm/fastify-raw-body#readme",
"devDependencies": {
"@types/node": "^18.0.0",
"fastify": "^4.0.0-rc.4",
"fastify": "^4.10.0",
"standard": "^17.0.0",
"tap": "^16.2.0",
"tsd": "^0.24.1"
Expand Down
2 changes: 1 addition & 1 deletion plugin.js
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ function rawBody (fastify, opts, next) {
next()

function preparsingRawBody (request, reply, payload, done) {
const applyLimit = request.context._parserOptions.limit ?? fastify.initialConfig.bodyLimit
const applyLimit = request.routeOptions.bodyLimit

getRawBody(runFirst ? request.raw : payload, {
length: null, // avoid content lenght check: fastify will do it
Expand Down

0 comments on commit bb650d2

Please sign in to comment.