Forum Discussion
Stephan_Manthe1
Nimbostratus
Jun 07, 2006inserting multiple variables into a single http header
hi,
we needed to add a single http-header including multiple variables (and some blanks!) like this:
SSLClientCipher: RC4-MD5, version=TLSv1/SSLv3, bits=128
it can be done in multiple ways:
when HTTP_REQUEST {
set sslinfo [SSL::cipher name]
set sslvers [SSL::cipher version]
set sslbits [SSL::cipher bits]
append sslinfo ", version=" $sslvers
append sslinfo ", bits=" $sslbits
HTTP::header insert SSLClientCipher $sslinfo
}
the following alternative might save some cpu-cycles:
when HTTP_REQUEST {
HTTP::header insert SSLClientCipher [SSL::cipher name],\x20version=[SSL::cipher version],\x20bits=[SSL::cipher bits]
}
the \x20 is used to create the required blanks between the different values.
ciao
stephan
- unRuleY_95363Historic F5 AccountDoesn't simply quoting it work?
HTTP::header insert SSLClientCipher "[SSL::cipher name], version=[SSL::cipher version], bits=[SSL::cipher bits]"
- StephanManthey
Nacreous
this was our first try. but it results in an additional header: - unRuleY_95363Historic F5 AccountI'm wondering if you need to add the "lws" argument to the command to get it to treat the spaces appropriately.
- Deb_Allen_18Historic F5 AccountI've been able to insert header values containing both spaces and double quotes by enclosing the value portion in curly braces:
inserts the following header: Header1: CP="IDC DSP OTR IND OTC"HTTP::header insert Header1 {CP="IDC DSP OTR IND OTC"}
Recent Discussions
Related Content
DevCentral Quicklinks
* Getting Started on DevCentral
* Community Guidelines
* Community Terms of Use / EULA
* Community Ranking Explained
* Community Resources
* Contact the DevCentral Team
* Update MFA on account.f5.com
Discover DevCentral Connects