Forum Discussion
hooleylist
Nov 07, 2012Cirrostratus
Hi Jen,
Which event are you running this code in? [HTTP::username] should return a null string if the username isn't present in an HTTP request. I don't think it *should* return a runtime error. Do you have any hints as to what type of client request triggers this runtime error?
In addition to using catch to handle the error, can you open a case with F5 Support to let them know about the runtime TCL error?
As for your specific question, yes you can use reject to close the TCP connection with a reset:
if { [catch {set myUser [HTTP::username] } ] } {
log local0. "Invalid username from [IP::remote_addr] using [HTTP::header User-Agent]"
reject
}
Thanks,
Aaron