zrhoffman commented on code in PR #7290:
URL: https://github.com/apache/trafficcontrol/pull/7290#discussion_r1070039804


##########
traffic_monitor/cache/astats.go:
##########
@@ -116,8 +117,23 @@ func astatsParse(cacheName string, rdr io.Reader, pollCTX 
interface{}) (Statisti
                astats.Ats["system.proc.loadavg"] = astats.System.ProcLoadavg
                astats.Ats["system.proc.net.dev"] = astats.System.ProcNetDev
 
+               via := ctx.HTTPHeader.Get("Via")

Review Comment:
   Please add the `Via` header to `rfc` package and include the RFC for it:
   
   
https://github.com/apache/trafficcontrol/blob/0321d207699d390fdfa6067616ef955d084628ff/lib/go-rfc/http.go#L31-L34



##########
traffic_monitor/cache/stats_over_http.json_new:
##########
@@ -0,0 +1,539 @@
+{

Review Comment:
   From Weasel:
   
   ```
   Error                                 Unknown! 
traffic_monitor/cache/stats_over_http.json_new
   ```
   
   Is `stats_over_http.json_new` needed? If it should stay, please add an 
exception for it in 
[`.dependency_license`](https://github.com/apache/trafficcontrol/blob/0321d20769/.dependency_license)
 to make Weasel happy.



##########
traffic_monitor/cache/stats_over_http.go:
##########
@@ -72,6 +73,14 @@
 
        ctx := pollCTX.(*poller.HTTPPollCtx)
 
+       via := ctx.HTTPHeader.Get("Via")
+       if via != "" {
+               result := regexp.MustCompile(` 
([a-z0-9\-]*)\..*comcast.net`).FindStringSubmatch(via)

Review Comment:
   As CodeQL says, `.net` should be `\.net` (here and in the other 2 places)



##########
traffic_monitor/cache/stats_over_http.go:
##########
@@ -72,6 +73,14 @@ func statsOverHTTPParse(cacheName string, data io.Reader, 
pollCTX interface{}) (
 
        ctx := pollCTX.(*poller.HTTPPollCtx)
 
+       via := ctx.HTTPHeader.Get("Via")
+       if via != "" {
+               result := regexp.MustCompile(` 
([a-z0-9\-]*)\..*comcast.net`).FindStringSubmatch(via)
+               if len(result) > 0 {
+                       cacheName = result[1]

Review Comment:
   Should this be `result[0]`?



-- 
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