trafficcontrol-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mitchell...@apache.org
Subject [incubator-trafficcontrol] branch master updated: Fix TO Go CRConfig for Perl magic LogReqHdrs param
Date Fri, 04 May 2018 15:58:12 GMT
This is an automated email from the ASF dual-hosted git repository.

mitchell852 pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-trafficcontrol.git


The following commit(s) were added to refs/heads/master by this push:
     new 00aaa96  Fix TO Go CRConfig for Perl magic LogReqHdrs param
00aaa96 is described below

commit 00aaa96a7b3a6e92f94219baf4bd0b9bdab35243
Author: Robert Butts <rob@apache.org>
AuthorDate: Thu May 3 16:19:01 2018 -0600

    Fix TO Go CRConfig for Perl magic LogReqHdrs param
---
 traffic_ops/traffic_ops_golang/crconfig/config.go | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/traffic_ops/traffic_ops_golang/crconfig/config.go b/traffic_ops/traffic_ops_golang/crconfig/config.go
index 8cdd871..29398fe 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 {

-- 
To stop receiving notification emails like this one, please contact
mitchell852@apache.org.

Mime
View raw message