Forum Discussion
Need Help in iRule to Modify HTTP header parameter.
- Jan 08, 2024
HTTP headers are not case sensitve in correctly implemented HTTP servers (see https://www.rfc-editor.org/rfc/rfc9110.html#name-field-names) , so the BIG-IP iRule command to handle them is also case insensitive (https://clouddocs.f5.com/api/irules/HTTP__header.html).
You'll have to first grab the header names (with any case), delete the headers (with any case), then re-add new headers (with your desired case). Something like this should work:
when HTTP_REQUEST {
set sname [HTTP::header value sname]
set uaccount [HTTP::header value uaccount]
HTTP::header remove sname
HTTP::header remove uaccount
HTTP::header replace SName $sname
HTTP::header replace UAccount $uaccount
}
HTTP headers are not case sensitve in correctly implemented HTTP servers (see https://www.rfc-editor.org/rfc/rfc9110.html#name-field-names) , so the BIG-IP iRule command to handle them is also case insensitive (https://clouddocs.f5.com/api/irules/HTTP__header.html).
You'll have to first grab the header names (with any case), delete the headers (with any case), then re-add new headers (with your desired case). Something like this should work:
when HTTP_REQUEST {
set sname [HTTP::header value sname]
set uaccount [HTTP::header value uaccount]
HTTP::header remove sname
HTTP::header remove uaccount
HTTP::header replace SName $sname
HTTP::header replace UAccount $uaccount
}
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