TaylorCFrey commented on a change in pull request #5345:
URL: https://github.com/apache/trafficcontrol/pull/5345#discussion_r540652995
##########
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:
Cool. I meant is there anything unique about 131072 vs, say, 32768? Is
that bits or bytes? According to
https://stackoverflow.com/questions/686217/maximum-on-http-header-values it
looks like the max header size is 4K to 8K, but it depends on the underlying
server or page files, etc. Not sure if this that is even relevant.
----------------------------------------------------------------
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]