Forum Discussion
rockthef5
Nimbostratus
7 years agoheader substr
Hi Guys, I have a header field coming from the http request. X-Akamai-Edgescape: georegion=263,country_code=US,region_code=MA,city=CAMBRIDGE,dma=506,pmsa=1120,areacode=617,county=MIDDLESEX,fips=25...
- 7 years ago
Try this
when HTTP_REQUEST { if {[HTTP::header exists "X-Akamai-Edgescape"]} { set headerList [split [HTTP::header value "X-Akamai-Edgescape"] ,] set countryCode [lindex $headerList [lsearch -glob $headerList "country_code=*"]] HTTP::header insert "x-test" $countryCode } }
Lee_Sutcliffe
Nacreous
7 years agoTry this
when HTTP_REQUEST {
if {[HTTP::header exists "X-Akamai-Edgescape"]} {
set headerList [split [HTTP::header value "X-Akamai-Edgescape"] ,]
set countryCode [lindex $headerList [lsearch -glob $headerList "country_code=*"]]
HTTP::header insert "x-test" $countryCode
}
}