Skip to content

Commit edd94a7

Browse files
committed
Removed logging
Removed logging http requests for security reasons
1 parent e316224 commit edd94a7

File tree

1 file changed

+6
-23
lines changed

1 file changed

+6
-23
lines changed

src/main/java/net/authorize/util/HttpClient.java

Lines changed: 6 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828
*
2929
*/
3030
public class HttpClient {
31-
private static Log logger = LogFactory.getLog(HttpClient.class);
31+
3232

3333
public static final String ENCODING = "UTF-8";
3434

@@ -90,7 +90,7 @@ private static Map<ResponseField, String> createResponseMap(Transaction transact
9090
transaction instanceof net.authorize.sim.Transaction) {
9191

9292
String decodedResponseData = URLDecoder.decode(responseString, HTTP.UTF_8);
93-
logger.debug("Url-decoded response data: " + decodedResponseData);
93+
9494

9595
responseMap = ResponseParser.parseResponseString(decodedResponseData);
9696
}
@@ -115,13 +115,7 @@ public static Map<ResponseField, String> execute(Environment environment, Transa
115115
// create the HTTP POST object
116116
HttpPost httpPost = createHttpPost(environment, transaction);
117117

118-
// get the raw data being sent for logging while in sandbox type modes
119-
if(Environment.SANDBOX.equals(environment) ||
120-
Environment.SANDBOX_TESTMODE.equals(environment)) {
121-
InputStream outstream = (InputStream)httpPost.getEntity().getContent();
122-
String requestData = convertStreamToString(outstream);
123-
logger.debug("SANDBOX MODES ONLY>> Url-encoded request data: " + requestData);
124-
}
118+
125119

126120
// execute the request
127121
HttpResponse httpResponse = httpClient.execute(httpPost);
@@ -147,7 +141,7 @@ public static Map<ResponseField, String> execute(Environment environment, Transa
147141

148142
responseMap = HttpClient.createResponseMap(transaction, rawResponseString);
149143
} catch (Exception e) {
150-
logger.error("HttpClient execution failed", e);
144+
151145
}
152146
}
153147

@@ -199,13 +193,6 @@ public static BasicXmlDocument executeXML(Environment environment, Transaction t
199193
// create the HTTP POST object
200194
HttpPost httpPost = createHttpPost(environment, transaction);
201195

202-
// get the raw data being sent for logging while in sandbox type modes
203-
if(Environment.SANDBOX.equals(environment) ||
204-
Environment.SANDBOX_TESTMODE.equals(environment)) {
205-
InputStream outstream = (InputStream)httpPost.getEntity().getContent();
206-
String requestData = convertStreamToString(outstream);
207-
logger.debug("SANDBOX MODES ONLY>> Url-encoded request data: " + requestData);
208-
}
209196

210197
// execute the request
211198
HttpResponse httpResponse = httpClient.execute(httpPost);
@@ -248,24 +235,20 @@ public static BasicXmlDocument executeXML(Environment environment, Transaction t
248235

249236
if(Environment.SANDBOX.equals(environment) ||
250237
Environment.SANDBOX_TESTMODE.equals(environment)) {
251-
logger.debug("SANDBOX MODES ONLY>> Response data: " + rawResponseString);
238+
252239
}
253240

254241
int mark = rawResponseString.indexOf("<?xml");
255242
if(mark == -1){
256-
logger.error("Invalid response");
257-
logger.error(rawResponseString);
258243
return null;
259244
}
260245

261246
response.parseString(rawResponseString.substring(mark,rawResponseString.length()));
262247
if(response.IsAccessible() == false){
263-
logger.error("Invalid response");
264-
logger.error(rawResponseString);
265248
return null;
266249
}
267250
} catch (Exception e) {
268-
logger.error("HttpClient execution failed", e);
251+
269252
}
270253
}
271254

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy