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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to