srijeet0406 commented on a change in pull request #5345:
URL: https://github.com/apache/trafficcontrol/pull/5345#discussion_r540608200
##########
File path: lib/go-tc/deliveryservices.go
##########
@@ -335,6 +349,46 @@ func ParseOrgServerFQDN(orgServerFQDN string) (*string,
*string, *string, error)
return &protocol, &FQDN, port, nil
}
+func (ds *DeliveryServiceV31) Sanitize() {
+ if ds.GeoLimitCountries != nil {
+ *ds.GeoLimitCountries =
strings.ToUpper(strings.Replace(*ds.GeoLimitCountries, " ", "", -1))
+ }
+ if ds.ProfileID != nil && *ds.ProfileID == -1 {
+ ds.ProfileID = nil
+ }
+ setNilIfEmpty(
+ &ds.EdgeHeaderRewrite,
+ &ds.MidHeaderRewrite,
+ &ds.FirstHeaderRewrite,
+ &ds.InnerHeaderRewrite,
+ &ds.LastHeaderRewrite,
+ )
+ if ds.RoutingName == nil || *ds.RoutingName == "" {
+ ds.RoutingName = util.StrPtr(DefaultRoutingName)
+ }
+ if ds.AnonymousBlockingEnabled == nil {
+ ds.AnonymousBlockingEnabled = util.BoolPtr(false)
+ }
+ signedAlgorithm := SigningAlgorithmURLSig
+ if ds.Signed && (ds.SigningAlgorithm == nil || *ds.SigningAlgorithm ==
"") {
+ ds.SigningAlgorithm = &signedAlgorithm
+ }
+ if !ds.Signed && ds.SigningAlgorithm != nil && *ds.SigningAlgorithm ==
signedAlgorithm {
+ ds.Signed = true
+ }
+ if ds.MaxOriginConnections == nil || *ds.MaxOriginConnections < 0 {
+ ds.MaxOriginConnections = util.IntPtr(0)
+ }
+ if ds.DeepCachingType == nil {
+ s := DeepCachingType("")
+ ds.DeepCachingType = &s
+ }
+ *ds.DeepCachingType =
DeepCachingTypeFromString(string(*ds.DeepCachingType))
+ if ds.MaxRequestHeaderSize == nil {
+ ds.MaxRequestHeaderSize = util.IntPtr(131072)
Review comment:
This is the default value used for our header sizes, I have made it into
a constant.
----------------------------------------------------------------
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]