From 2619a877b2ed32ca7b48137ae44aa0ed894f9a7e Mon Sep 17 00:00:00 2001 From: Sam Kelleher Date: Tue, 4 Aug 2020 11:23:57 +0100 Subject: [PATCH] fix: include XFF-proto on hydra get requests Signed-off-by: Sam Kelleher --- server/hydra.js | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/server/hydra.js b/server/hydra.js index 809f5a8..d73be25 100644 --- a/server/hydra.js +++ b/server/hydra.js @@ -25,7 +25,14 @@ if (MOCK_TLS_TERMINATION) { */ const get = async (flow, challenge) => { try { - const res = await fetch(`${HYDRA_ADMIN_URL}/oauth2/auth/requests/${flow}?${flow}_challenge=${challenge}`); + const res = await fetch( + `${HYDRA_ADMIN_URL}/oauth2/auth/requests/${flow}?${flow}_challenge=${challenge}`, + { + headers: { + ...mockTlsTermination + } + } + ); if (res.status < 200 || res.status > 302) { const json = await res.json(); Logger.error(`An error occurred while making GET ${flow}-${challenge} HTTP request to Hydra: `, json.error_description);