Skip to content
This repository was archived by the owner on Nov 24, 2025. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,7 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/).
- [#6695](https://github.com/apache/trafficcontrol/issues/6695) *Traffic Control Cache Config (t3c)* Directory creation was erroneously reporting an error when actually succeeding.
- [#7411](https://github.com/apache/trafficcontrol/pull/7411) *Traffic Control Cache Config (t3c)* Fixed issue with wrong parent ordering with MSO non-topology delivery services.
- [#7425](https://github.com/apache/trafficcontrol/pull/7425) *Traffic Control Cache Config (t3c)* Fixed issue with layered profile iteration being done in the wrong order.
- [#6385](https://github.com/apache/trafficcontrol/issues/6385) *Traffic Ops* Reserved consistentHashQueryParameters cause internal server error

## [7.0.0] - 2022-07-19
### Added
Expand Down
9 changes: 9 additions & 0 deletions lib/go-tc/deliveryservices.go
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,15 @@ const MaxRangeSliceBlockSize = 33554432
// values of a Delivery Service's 'Active' property (v3.0+).
type DeliveryServiceActiveState string

// These names of URL query string parameters are not allowed to be in a
// Delivery Service's "ConsistentHashQueryParams" set, because they collide with
// query string parameters reserved for use by Traffic Router.
const (
ReservedConsistentHashingQueryParameterFormat = "format"
ReservedConsistentHashingQueryParameterTRRED = "trred"
ReservedConsistentHashingQueryParameterFakeClientIPAddress = "fakeClientIpAddress"
)

// A DeliveryServiceActiveState describes the availability of Delivery Service
// content from the perspective of caching servers and Traffic Routers.
const (
Expand Down
14 changes: 12 additions & 2 deletions traffic_ops/traffic_ops_golang/deliveryservice/deliveryservices.go
Original file line number Diff line number Diff line change
Expand Up @@ -1714,10 +1714,20 @@ func validateTypeFields(tx *sql.Tx, ds *tc.DeliveryServiceV5) error {
"consistentHashQueryParams": validation.Validate(ds,
validation.By(func(dsi interface{}) error {
ds := dsi.(*tc.DeliveryServiceV5)
if len(ds.ConsistentHashQueryParams) == 0 || tc.DSType(typeName).IsHTTP() {
if len(ds.ConsistentHashQueryParams) == 0 {
return nil
}
return fmt.Errorf("consistentHashQueryParams not allowed for '%s' deliveryservice type", typeName)
if !tc.DSType(typeName).IsHTTP() {
return fmt.Errorf("consistentHashQueryParams not allowed for '%s' deliveryservice type", typeName)
}

for _, param := range ds.ConsistentHashQueryParams {
if param == tc.ReservedConsistentHashingQueryParameterFormat || param == tc.ReservedConsistentHashingQueryParameterTRRED || param == tc.ReservedConsistentHashingQueryParameterFakeClientIPAddress {
return fmt.Errorf("'%s' cannot be used in consistent hashing, because it is reserved for use by Traffic Router", param)
}
}

return nil
})),
"initialDispersion": validation.Validate(ds.InitialDispersion,
validation.By(requiredIfMatchesTypeName([]string{httpTypeRegexp}, typeName)),
Expand Down