From 671030da34a32752bca1e551579fa559f1182588 Mon Sep 17 00:00:00 2001 From: Nicolas Thouvenin Date: Thu, 26 Oct 2023 22:28:02 +0200 Subject: [PATCH] =?UTF-8?q?fix:=20=F0=9F=90=9B=20attempts=20to=20fix=20los?= =?UTF-8?q?t=20body=20with=20proxy?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- packages/core/src/server/errorHandler.js | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/packages/core/src/server/errorHandler.js b/packages/core/src/server/errorHandler.js index 53c3f317..db76f578 100644 --- a/packages/core/src/server/errorHandler.js +++ b/packages/core/src/server/errorHandler.js @@ -1,5 +1,4 @@ import debug from 'debug'; -import Parameter from '../parameter'; import { httpRequestErrorTotal } from './metrics'; const errorHandler = (request, response) => (error, code = 400) => { @@ -9,10 +8,10 @@ const errorHandler = (request, response) => (error, code = 400) => { return response.end(); } const bodyResponse = JSON.stringify(error); - response.setHeader('Content-Type', 'application/json'); - response.setHeader('Content-Length', bodyResponse.length); - response.setHeader('Content-Disposition', 'inline'); - response.writeHead(code, { 'X-Error': Parameter.encode(error.toString()) }); + response.writeHead(code, { + 'Content-Type': 'application/json', + 'Content-Length': bodyResponse.length, + }); return response.end(bodyResponse); };