Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
anuvedverma committed Jul 2, 2024
1 parent e781b3f commit ce4691f
Showing 1 changed file with 13 additions and 24 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -74,35 +74,25 @@ protected void postConnectionHook(
+ " servlet path {} , toString {}, size {}", request.getRequestURL(),
request.getRequestURI(), request.getServletPath(), request.toString(), request.getContentLength(), var9);

String requestHeaderLog = getErrorLogHeaders(request);
log.error(requestHeaderLog);

String responseHeaderLog = getErrorLogHeaders(response);
log.error(responseHeaderLog);
errorLogHeaders(request);
errorLogHeaders(response);;
callback.failed(var9);
}
}

protected String getErrorLogHeaders(HttpServletRequest request) {
StringBuilder sb = new StringBuilder();
sb.append("------- error HttpServletRequest headers---------\n");
protected void errorLogHeaders(HttpServletRequest request) {
log.error("------- error HttpServletResponse headers---------");
Enumeration<String> headers = request.getHeaderNames();
while (headers.hasMoreElements()) {
String header = headers.nextElement();
sb.append(header).append("->").append(request.getHeader(header)).append("\n");
for (String header : headers) {
log.error(header + "->" + request.getHeader(header));
} }

protected void errorLogHeaders(HttpServletResponse response) {
log.error("------- error HttpServletResponse headers---------");
Collection<String> headers = response.getHeaderNames();
for (String header : headers) {
log.error(header + "->" + response.getHeader(header));
}
return sb.toString();
}

protected String getErrorLogHeaders(HttpServletResponse response) {
StringBuilder sb = new StringBuilder();
sb.append("------- error HttpServletResponse headers---------\n");
Enumeration<String> headers = response.getHeaderNames();
while (headers.hasMoreElements()) {
String header = headers.nextElement();
sb.append(header).append("->").append(response.getHeader(header)).append("\n");
}
return sb.toString();
}

protected void debugLogHeaders(HttpServletRequest request) {
Expand All @@ -125,7 +115,6 @@ protected void debugLogHeaders(HttpServletResponse response) {
}
}
}

protected void debugLogHeaders(Request proxyRequest) {
if (log.isDebugEnabled()) {
log.debug("-------Request proxyRequest headers---------");
Expand Down

0 comments on commit ce4691f

Please sign in to comment.