This is an automated email from the ASF dual-hosted git repository.
srijeet0406 pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/trafficcontrol.git
The following commit(s) were added to refs/heads/master by this push:
new bf961a636d Fix APIv5 attempting to validate Delete-type DSRs as v4
structures (#7256)
bf961a636d is described below
commit bf961a636d19cf6dae2f55d6313124d1af736bb4
Author: ocket8888 <[email protected]>
AuthorDate: Fri Dec 16 11:18:26 2022 -0700
Fix APIv5 attempting to validate Delete-type DSRs as v4 structures (#7256)
---
traffic_ops/traffic_ops_golang/deliveryservice/request/validate.go | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/traffic_ops/traffic_ops_golang/deliveryservice/request/validate.go
b/traffic_ops/traffic_ops_golang/deliveryservice/request/validate.go
index 963543d617..557baf3fbb 100644
--- a/traffic_ops/traffic_ops_golang/deliveryservice/request/validate.go
+++ b/traffic_ops/traffic_ops_golang/deliveryservice/request/validate.go
@@ -84,7 +84,7 @@ func validateV4(dsr tc.DeliveryServiceRequestV4, tx *sql.Tx)
(error, error) {
return validateV5(dsr.Upgrade(), tx)
}
-// validateV4 validates a DSR, returning - in order - a user-facing error that
+// validateV5 validates a DSR, returning - in order - a user-facing error that
// should be shown to the client, and a system error.
func validateV5(dsr tc.DeliveryServiceRequestV5, tx *sql.Tx) (error, error) {
var userErr, sysErr error
@@ -143,7 +143,7 @@ func validateV5(dsr tc.DeliveryServiceRequestV5, tx
*sql.Tx) (error, error) {
if o == nil {
return fmt.Errorf("required for
changeType='%s'", dsr.ChangeType)
}
- ds, ok := o.(*tc.DeliveryServiceV4)
+ ds, ok := o.(*tc.DeliveryServiceV5)
if !ok {
return fmt.Errorf("expected a Delivery
Service, got %T", o)
}