rawlinp commented on a change in pull request #5345:
URL: https://github.com/apache/trafficcontrol/pull/5345#discussion_r544575384



##########
File path: lib/go-tc/deliveryservices.go
##########
@@ -541,6 +541,17 @@ func (ds *DeliveryServiceNullableV30) 
validateTypeFields(tx *sql.Tx) error {
                                }
                                return nil
                        })),
+               "maxRequestHeaderBytes": validation.Validate(ds,
+                       validation.By(func(dsi interface{}) error {
+                               ds := dsi.(*DeliveryServiceNullableV30)
+                               if ds.MaxRequestHeaderBytes == nil {
+                                       return 
fmt.Errorf("maxRequestHeaderBytes empty, must be a valid positive value")

Review comment:
       Since we include 0 as a valid value, should we say `nonnegative` instead 
of `positive`? Also this can be `errors.New` instead of `fmt.Errorf` since no 
formatting is done.

##########
File path: lib/go-tc/deliveryservices.go
##########
@@ -541,6 +541,17 @@ func (ds *DeliveryServiceNullableV30) 
validateTypeFields(tx *sql.Tx) error {
                                }
                                return nil
                        })),
+               "maxRequestHeaderBytes": validation.Validate(ds,
+                       validation.By(func(dsi interface{}) error {
+                               ds := dsi.(*DeliveryServiceNullableV30)
+                               if ds.MaxRequestHeaderBytes == nil {
+                                       return 
fmt.Errorf("maxRequestHeaderBytes empty, must be a valid positive value")
+                               }
+                               if *ds.MaxRequestHeaderBytes <= 0 {
+                                       return 
fmt.Errorf("maxRequestHeaderBytes must be a valid positive value")

Review comment:
       dittor prior comment

##########
File path: traffic_ops/traffic_ops_golang/deliveryservice/deliveryservices.go
##########
@@ -796,11 +880,6 @@ func updateV30(w http.ResponseWriter, r *http.Request, inf 
*api.APIInfo, ds *tc.
                                return nil, status, userErr, sysErr
                        }
                }
-
-               userErr, sysErr, status := 
dbhelpers.CheckOriginServerInCacheGroupTopology(tx, *ds.ID, *ds.Topology)

Review comment:
       Was this section deleted by accident? It seems like this should be 
causing a test failure, but it looks like the test for this validation is 
passing even though it shouldn't be...




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


Reply via email to