26-Oct-2020 15:12
Is there a way I can write an irule so when a GET request comes to a VS on a specific URL: https://abctest1234.com/general/api, if a header value does not match on multiple ClientID such as (ClientID: RealCategory, ClientID: TrueCategory, or ClientID: BlueCategory), we want to return a 401 unauthorize response back to the client?
Solved! Go to Solution.
29-Oct-2020
08:29
- last edited on
04-Jun-2023
21:13
by
JimmyPackets
when HTTP_REQUEST {
if { [[HTTP::host][HTTP::uri] eq "abctest1234.com/general/api"] && [[HTTP::header value "ClientID"] ne "RealCategory" || [HTTP::header value "ClientID"] ne "TrueCategory" || [HTTP::header value "ClientID"] ne "BlueCategory"]}{
HTTP::respond 401
}
}
29-Oct-2020
08:29
- last edited on
04-Jun-2023
21:13
by
JimmyPackets
when HTTP_REQUEST {
if { [[HTTP::host][HTTP::uri] eq "abctest1234.com/general/api"] && [[HTTP::header value "ClientID"] ne "RealCategory" || [HTTP::header value "ClientID"] ne "TrueCategory" || [HTTP::header value "ClientID"] ne "BlueCategory"]}{
HTTP::respond 401
}
}
02-Nov-2020 15:53
Thanks Andrew! This seems to work.