You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@trafficcontrol.apache.org by "zrhoffman (via GitHub)" <gi...@apache.org> on 2023/02/02 23:44:38 UTC
[GitHub] [trafficcontrol] zrhoffman commented on a diff in pull request #7340: Fix TR logging when cqhv field is absent
zrhoffman commented on code in PR #7340:
URL: https://github.com/apache/trafficcontrol/pull/7340#discussion_r1095206309
##########
traffic_router/core/src/main/java/org/apache/traffic_control/traffic_router/core/http/HTTPAccessEventBuilder.java:
##########
@@ -84,7 +92,11 @@ public static String create(final HTTPAccessRecord httpAccessRecord) {
String chi = formatObject(httpServletRequest.getRemoteAddr());
final String url = formatRequest(httpServletRequest);
final String cqhm = formatObject(httpServletRequest.getMethod());
- final String cqhv = formatObject(httpServletRequest.getProtocol());
+ String cqhv = "-";
+ final String protocol = formatObject(httpServletRequest.getProtocol());
+ if (validProtocol(protocol)) {
+ cqhv = protocol;
+ }
Review Comment:
`formatObject()` already defaults the string to `-` if the argument is null. Rather than making a new `validProtocol()` function, should `formatObject()` check for empty strings too?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@trafficcontrol.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org