Commit 8a3e0a2
fix(nest): honor routed request during input decoding (#1922)
`ImplementInterceptor` currently decodes procedure input from the
initial `standardRequest`, even when a routing interceptor passes a
replacement request to `StandardHandler`. This prevents request wrappers
such as `RequestLimitHandlerPlugin` from taking effect during Nest input
decoding.
## Fixes
- Decode procedure input from the request passed to `resolveProcedure`
after routing interceptors have run.
- Restore `RequestLimitHandlerPlugin` enforcement for `@orpc/nest`
without changing the public API.
- Keep the existing Nest route parameter extraction behavior unchanged.
## Testing
- Added an integration regression test for both Express and Fastify
adapters.
- Before the fix, both cases returned `200` for a request above the
configured limit.
- After the fix, both cases return `413 PAYLOAD_TOO_LARGE`.
- `pnpm exec vitest run packages/nest/src/implement.test.ts` — 90 tests
passed.
- `pnpm lint`
- `pnpm type:check`
- `pnpm docs:validate`
Fixes #1921
---------
Co-authored-by: Dinh Le <dinwwwh@gmail.com>1 parent cc68d42 commit 8a3e0a2
2 files changed
Lines changed: 47 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
11 | 11 | | |
12 | 12 | | |
13 | 13 | | |
| 14 | + | |
14 | 15 | | |
15 | 16 | | |
16 | 17 | | |
| |||
1473 | 1474 | | |
1474 | 1475 | | |
1475 | 1476 | | |
| 1477 | + | |
| 1478 | + | |
| 1479 | + | |
| 1480 | + | |
| 1481 | + | |
| 1482 | + | |
| 1483 | + | |
| 1484 | + | |
| 1485 | + | |
| 1486 | + | |
| 1487 | + | |
| 1488 | + | |
| 1489 | + | |
| 1490 | + | |
| 1491 | + | |
| 1492 | + | |
| 1493 | + | |
| 1494 | + | |
| 1495 | + | |
| 1496 | + | |
| 1497 | + | |
| 1498 | + | |
| 1499 | + | |
| 1500 | + | |
| 1501 | + | |
| 1502 | + | |
| 1503 | + | |
| 1504 | + | |
| 1505 | + | |
| 1506 | + | |
| 1507 | + | |
| 1508 | + | |
| 1509 | + | |
| 1510 | + | |
| 1511 | + | |
| 1512 | + | |
| 1513 | + | |
| 1514 | + | |
| 1515 | + | |
| 1516 | + | |
| 1517 | + | |
| 1518 | + | |
| 1519 | + | |
| 1520 | + | |
1476 | 1521 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
194 | 194 | | |
195 | 195 | | |
196 | 196 | | |
197 | | - | |
| 197 | + | |
198 | 198 | | |
199 | 199 | | |
200 | 200 | | |
201 | 201 | | |
202 | 202 | | |
203 | | - | |
| 203 | + | |
204 | 204 | | |
205 | 205 | | |
206 | 206 | | |
| |||
0 commit comments