@nitra/fastify 2.5.8 → 2.5.9

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/package.json +1 -1
  2. package/src/index.js +7 -0
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nitra/fastify",
3
- "version": "2.5.8",
3
+ "version": "2.5.9",
4
4
  "description": "Fastify helper",
5
5
  "keywords": [
6
6
  "fastify",
package/src/index.js CHANGED
@@ -13,6 +13,13 @@ export const app = fastify({
13
13
  // http2: !!env.K_SERVICE // Запускаємо з http2 якщо в Cloud Run
14
14
  })
15
15
 
16
+ // За проксі (Cloudflare, nginx тощо) можуть приходити запити з невідомим/порожнім Content-Type → 415.
17
+ // Дозволяємо будь-який тип: тіло не парситься, req.body лишається undefined.
18
+ app.addContentTypeParser('*', (req, payload, done) => {
19
+ payload.resume()
20
+ done(null, undefined)
21
+ })
22
+
16
23
  app.register(fastifySensible) // для reply.badRequest(`Not found url: ${req.url} ...`)
17
24
 
18
25
  // Опрацювання запитів OPTIONS