Forum Discussion
daboochmeister
Jul 16, 2018Cirrus
Two iRules that seem to conflict
Env: LTM 11.5.2 (hardware, not VM) We have two iRules that work correctly independently, but when we apply them both to a virtual server, cause an error. The error is: TCL error: /Common/esb-...
youssef1
Jul 17, 2018Cumulonimbus
Hi,
the error you see is most likely caused because a previous iRule has already responded the ongoing HTTP request.
After the HTTP request is responded an attempt to modify the HTTP headers will create that kind of TCL exemption.
did you try to combine both irule?
when HTTP_REQUEST {
if { [HTTP::username] eq "" or [HTTP::password] eq "" } {
HTTP::respond 401 WWW-Authenticate "Basic realm=\"AWS Alexa Credentials Required\""
return
}
binary scan [md5 [HTTP::password]] H* password
log local0. "Pw [HTTP::password] MD5 is $password"
if { [class lookup "[HTTP::username]" AWS-Alexa_QA_Account] equals $password } {
log local0. "User [HTTP::username] has been authorized to access virtual server [virtual name]"
} else {
log local0. "User [HTTP::username] has been denied access to virtual server [virtual name] using password [$password]"
HTTP::respond 401 WWW-Authenticate "Basic realm=\"AWS Alexa Credentials Required\""
return
}
STREAM::disable
HTTP::header remove "Accept-Encoding"
}
when HTTP_RESPONSE {
STREAM::disable
log local0. "Adjusting values"
STREAM::expression {@:443@@ @pl-ts-esb-esb01.dev.psegliny@esb-qa-secure-aws.psegliny.com@ @pl-ts-esb-esb02.dev.psegliny@esb-qa-secure-aws.psegliny.com@ @pl-ts-esb-esb03.dev.psegliny@esb-qa-secure-aws.psegliny.com@ @pl-ts-esb-esb04.dev.psegliny@esb-qa-secure-aws.psegliny.com@}
STREAM::enable
}
Last point, you ca notice that i add a return in irule above as specify below:
else {
log local0. "User [HTTP::username] has been denied access to virtual server [virtual name] using password [$password]"
HTTP::respond 401 WWW-Authenticate "Basic realm=\"AWS Alexa Credentials Required\""
return
}
Recent Discussions
Related Content
DevCentral Quicklinks
* 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
Discover DevCentral Connects