07-Dec-2021
13:26
- last edited on
22-Nov-2022
15:01
by
JimmyPackets
Via iRule, trying to remove duplicate Strict-Transport-Security headers (developers are unable to), the below code does not seem to work.
when HTTP_REQUEST {
foreach a_header [HTTP::header "Strict-Transport-Security"] {
if {[HTTP::header $a_header] eq "max-age=2592000"}{
HTTP::header remove $a_header
}
}
}
The below seems to work but gets rid of Strict-Transport-Security as a whole, which I do not want to do:
when HTTP_RESPONSE {
foreach header {Strict-Transport-Security} {
HTTP::header remove "Strict-Transport-Security"
HTTP::header remove "max-age=2592000"
}
}
Solved! Go to Solution.
08-Dec-2021 02:07
You can use something like below
when HTTP_RESPONSE {
HTTP::header remove "Strict-Transport-Security"
HTTP::header insert Strict-Transport-Security "max-age=2592000"
}
08-Dec-2021 02:07
You can use something like below
when HTTP_RESPONSE {
HTTP::header remove "Strict-Transport-Security"
HTTP::header insert Strict-Transport-Security "max-age=2592000"
}
13-Dec-2021
11:05
- last edited on
24-Mar-2022
01:21
by
li-migration
Appreciate the assist, that worked. Thank you