Forum Discussion
Help deleting header name that contains curly braces
- Nov 18, 2022
I think I just figured it out guys Mohamed_Ahmed_Kansoh CA_Valli
Paste this and run it. It worked out for me. Now any of you can explain why this works?? Is this a bug with F5? At least it seems to me. If it is, how can I let them know so they can fix it.
when HTTP_REQUEST { if { [HTTP::uri] eq "/demo2" } { HTTP::header insert "{esbsoapheader}userName" "spencer" foreach aHeader [HTTP::header names] { log local0. "HTTP Request Headers: $aHeader: [HTTP::header value $aHeader]" } log local0. "***************REMOVING BAD HEADER************" HTTP::header remove "\\{esbsoapheader\\}userName" foreach aHeader [HTTP::header names] { log local0. "HTTP Request Headers: $aHeader: [HTTP::header value $aHeader]" } } }
I think I just figured it out guys Mohamed_Ahmed_Kansoh CA_Valli
Paste this and run it. It worked out for me. Now any of you can explain why this works?? Is this a bug with F5? At least it seems to me. If it is, how can I let them know so they can fix it.
when HTTP_REQUEST {
if { [HTTP::uri] eq "/demo2" } {
HTTP::header insert "{esbsoapheader}userName" "spencer"
foreach aHeader [HTTP::header names] {
log local0. "HTTP Request Headers: $aHeader: [HTTP::header value $aHeader]"
}
log local0. "***************REMOVING BAD HEADER************"
HTTP::header remove "\\{esbsoapheader\\}userName"
foreach aHeader [HTTP::header names] {
log local0. "HTTP Request Headers: $aHeader: [HTTP::header value $aHeader]"
}
}
}
- JRahmNov 22, 2022Admin
Nice work, Spencer_Aranda! The reason you need this is to escape the special characters. Both "\" and "{ }" are special characters in Tcl, so the "\\{" pattern is to escape both so you can actual match as the string as intended.
- Leslie_HubertusNov 23, 2022Ret. Employee
Hey Spencer_Aranda - what a great conversation you kicked off here!
JRahm pointed out the special character thing, but to report a bug in the future, please contact F5 Support and give them the details so they can create a report. 🙂
(edited) - Nov 18, 2022
Spencer_Aranda ,
It doesn’t make sense , but I will add it to my Notes.
I do not know why it works after " \\ \\ " it’s strange !!- Spencer_ArandaNov 18, 2022Altocumulus
Thanks Mohamed_Ahmed_Kansoh
Hopefully in the future you can let me know how/why this works the way it does. And hopefully this can get fixed.
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