mitchell852 commented on a change in pull request #3559: TO: Hdr rw config test
URL: https://github.com/apache/trafficcontrol/pull/3559#discussion_r283546503
##########
File path: traffic_ops/traffic_ops_golang/ats/headerrewrite.go
##########
@@ -73,12 +74,14 @@ func GetEdgeHeaderRewriteDotConfig(w http.ResponseWriter,
r *http.Request) {
api.HandleErr(w, r, inf.Tx.Tx,
http.StatusInternalServerError, nil, errors.New("getting ds server count:
"+err.Error()))
return
}
- maxOriginConnectionsPerEdge :=
int(math.Round(float64(maxOriginConnections) / float64(dsOnlineEdgeCount)))
- text += "cond %{REMAP_PSEUDO_HOOK}\nset-config
proxy.config.http.origin_max_connections " +
strconv.Itoa(maxOriginConnectionsPerEdge)
- if ds.EdgeHeaderRewrite == nil {
- text += " [L]"
- } else {
- text += "\n"
+ if dsOnlineEdgeCount > 0 {
Review comment:
nice catch! divide by zero...ug...
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services