Forum Discussion
Display specific headers
I'm passing PKI certificate information inside headers and have a VIP that displays a user's headers for troubleshooting access problems. I updated my iRule to insert the entire certificate into a header but I don't want this information displayed along with the headers I usually pass. How can I display all of my headers except the one titled base64?
How I insert the whole certifiate into the headers:
HTTP::header replace BASE64 [X509::whole [SSL::cert 0]]
How I normally display headers on my troubleshooting site:
foreach header [HTTP::header names] {
set HEADER_RESPONSE "$HEADER_RESPONSE > $header = [HTTP::header $header]
"
}
My attempt to fix exclude the whole certificate header:
foreach header [HTTP::header names] {
if { ! [matchclass [string tolower [HTTP::header names]] starts_with "base" ]} {
set HEADER_RESPONSE "$HEADER_RESPONSE > $header = [HTTP::header $header]
"}}
2 Replies
- Arnaud_Lemaire
Employee
Hello, what are you using matchclass in you condition ? remove that and that should do the trick.
- samstep
Cirrocumulus
you don't need matchclass as it is for datagroup matching.
This is a bit of a basic programming errror. All you need to do is just skip the loop iteration you don't want using continue operator:
foreach header [HTTP::header names] { if {$header eq "BASE64"} {continue} set HEADER_RESPONSE "$HEADER_RESPONSE > $header = [HTTP::header $header] " }Hope this helps,
Sam
Help guide the future of your DevCentral Community!
What tools do you use to collaborate? (1min - anonymous)Recent Discussions
Related Content
* 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
