feat(proxy-backend): configure request body revival for all targets

Signed-off-by: Dan Hoizner <dan.hoizner@gmail.com>
This commit is contained in:
Dan Hoizner
2023-02-14 15:48:47 -05:00
parent a30d2e8df5
commit 3e3eea4bc7
7 changed files with 96 additions and 44 deletions
+16
View File
@@ -0,0 +1,16 @@
---
'@backstage/plugin-proxy-backend': patch
---
The proxy-backend plugin now supports reviving request bodies that have previously been consumed by an express middleware (e.g. `express.json()`). This is done by setting `reviveConsumedRequestBodies: true` on the proxy `RouterOptions`. In order to preserve the current behavior, the proxy will **not** revive request bodies by default.
The following is an example of a proxy `createRouter` invocation that revives request bodies:
```diff
const router = await createRouter({
config,
logger,
discovery,
+ reviveConsumedRequestBodies: true,
});
```