Forum Discussion
Replace an header authorization request with policy or iRule doesn't work ...
- Apr 29, 2021
Try below. Modify the names of the header if needed. You can enable logging to see if it's replacing as expected.
when HTTP_REQUEST { if { [HTTP::header exists "X-epsilon-Authorization"] } { set value [HTTP::header value X-epsilon-Authorization] HTTP::header remove X-epsilon-Authorization HTTP::header insert Authorization $value } else { return } foreach aHeader [HTTP::header names] { # log local0. "$aHeader: [HTTP::header value $aHeader]" } }
Try below. Modify the names of the header if needed. You can enable logging to see if it's replacing as expected.
when HTTP_REQUEST {
if { [HTTP::header exists "X-epsilon-Authorization"] } {
set value [HTTP::header value X-epsilon-Authorization]
HTTP::header remove X-epsilon-Authorization
HTTP::header insert Authorization $value
} else {
return
}
foreach aHeader [HTTP::header names] {
# log local0. "$aHeader: [HTTP::header value $aHeader]"
}
}
Hi SanjayP,
Thanks for reply !
I try the irule but that return an error: "01070151:3: Rule [/Common/A_irule] error: /Common/A_irule:2: error: [parse error: PARSE syntax 33 {syntax error in expression " HTTP::header exists X-mafrenchbank-Authorization ": variable references require preceding $}][{ HTTP::header exists X-mafrenchbank-Authorization }]"
Thanks
- ckteurApr 30, 2021Cirrus
It works !!
Just the hooks were missing [HTTP::header exists "X-epsilon-Authorization"]
The irule run perfectly and the value of Header has been changed.
Thanks a lot and have a good day !
- jaikumar_f5Apr 30, 2021MVP
Please mark answer as solution provided, So the thread can be marked closed & would help others if they come across such.
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