From 1152b3e70aad6a9159dd43269bce72cce27e85d0 Mon Sep 17 00:00:00 2001 From: Yashar Robert Date: Thu, 30 May 2024 16:04:35 +0200 Subject: [PATCH] AB#117091 Pass body's to upstream --- jwtproxy/src/server.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/jwtproxy/src/server.py b/jwtproxy/src/server.py index 17481bbc..da390001 100755 --- a/jwtproxy/src/server.py +++ b/jwtproxy/src/server.py @@ -211,12 +211,18 @@ async def handle(req: web.Request): app_logger.debug("Proxy-URL: \n%s", target_url) app_logger.debug("Request params: \n %s", req.rel_url.query) app_logger.debug("Request headers: \n %s", req.headers) + if token is not None: await audit(req, token) + body = None + if req.can_read_body: + body = await req.text() + app_logger.debug("Request body: \n %s", body) + async with SessionManager.session().request( - req.method, target_url, headers=req.headers, params=req.rel_url.query + req.method, target_url, headers=req.headers, params=req.rel_url.query, data=body ) as resp: app_logger.debug("Response status from upstream: %s", resp.status) app_logger.debug("Headers from upstream: \n %s", resp.headers)