mitchell852 closed pull request #2225: Fix Traffic Ops Golang CRConfig to match
Perl's magic LogRequestHeaders parameter handling
URL: https://github.com/apache/incubator-trafficcontrol/pull/2225
This is a PR merged from a forked repository.
As GitHub hides the original diff on merge, it is displayed below for
the sake of provenance:
As this is a foreign pull request (from a fork), the diff is supplied
below (as it won't show otherwise due to GitHub magic):
diff --git a/traffic_ops/traffic_ops_golang/crconfig/config.go
b/traffic_ops/traffic_ops_golang/crconfig/config.go
index 8cdd871a0..29398fead 100644
--- a/traffic_ops/traffic_ops_golang/crconfig/config.go
+++ b/traffic_ops/traffic_ops_golang/crconfig/config.go
@@ -38,6 +38,7 @@ func makeCRConfigConfig(cdn string, db *sql.DB, dnssecEnabled
bool, domain strin
const soaPrefix = "tld.soa."
const ttlPrefix = "tld.ttls."
const maxmindDefaultOverrideParameterName = "maxmind.default.override"
+ const logRequestHeadersParameterName = "LogRequestHeaders"
crConfigConfig := map[string]interface{}{}
for _, param := range configParams {
k := param.Name
@@ -46,6 +47,12 @@ func makeCRConfigConfig(cdn string, db *sql.DB,
dnssecEnabled bool, domain strin
soa[k[len(soaPrefix):]] = v
} else if strings.HasPrefix(k, ttlPrefix) {
ttl[k[len(ttlPrefix):]] = v
+ } else if k == logRequestHeadersParameterName {
+ hdrs := []string{}
+ for _, hdr := range strings.Split(param.Value,
`__RETURN__`) {
+ hdrs = append(hdrs, strings.TrimSpace(hdr))
+ }
+ crConfigConfig["requestHeaders"] = hdrs
} else if k == maxmindDefaultOverrideParameterName {
overrideObj, err := createMaxmindDefaultOverrideObj(v)
if err != nil {
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services