From b7d6fd273600dce06c6f46c38990dff465fbf2f2 Mon Sep 17 00:00:00 2001 From: Claudia Murialdo Date: Wed, 3 Aug 2022 13:53:01 -0300 Subject: [PATCH] Do not expose information through exception at new implementation of HttpClient. --- .../src/dotnetframework/GxClasses/Domain/GxHttpClient.cs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/dotnet/src/dotnetframework/GxClasses/Domain/GxHttpClient.cs b/dotnet/src/dotnetframework/GxClasses/Domain/GxHttpClient.cs index ca6d812bc..db488e0d6 100644 --- a/dotnet/src/dotnetframework/GxClasses/Domain/GxHttpClient.cs +++ b/dotnet/src/dotnetframework/GxClasses/Domain/GxHttpClient.cs @@ -767,7 +767,7 @@ public void HttpClientExecute(string method, string name) else _errDescription = aex.Message; response = new HttpResponseMessage(); - response.Content = new StringContent(_errDescription); + response.Content = new StringContent(HttpHelper.StatusCodeToTitle(HttpStatusCode.InternalServerError)); response.StatusCode = HttpStatusCode.InternalServerError; } #endif @@ -780,7 +780,7 @@ public void HttpClientExecute(string method, string name) else _errDescription = e.Message; response = new HttpResponseMessage(); - response.Content = new StringContent(_errDescription); + response.Content = new StringContent(HttpHelper.StatusCodeToTitle(HttpStatusCode.InternalServerError)); #if NETCORE response.StatusCode = (HttpStatusCode)(e.StatusCode != null ? e.StatusCode : HttpStatusCode.InternalServerError); #else @@ -794,7 +794,7 @@ public void HttpClientExecute(string method, string name) _errDescription = "The request has timed out. " + e.Message; response = new HttpResponseMessage(); response.StatusCode = 0; - response.Content = new StringContent(""); + response.Content = new StringContent(String.Empty); } catch (Exception e) { @@ -805,7 +805,7 @@ public void HttpClientExecute(string method, string name) else _errDescription = e.Message; response = new HttpResponseMessage(); - response.Content = new StringContent(_errDescription); + response.Content = new StringContent(HttpHelper.StatusCodeToTitle(HttpStatusCode.InternalServerError)); response.StatusCode = HttpStatusCode.InternalServerError; } GXLogging.Debug(log, "Reading response...");