Skip to content

Commit

Permalink
Partially fixes #29. Will reopen when implementing chaining.
Browse files Browse the repository at this point in the history
  • Loading branch information
landro committed Aug 13, 2014
1 parent ebcec78 commit 4fe6e35
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 2 deletions.
2 changes: 1 addition & 1 deletion irules/simple_irule.tcl
@@ -1,6 +1,6 @@
rule simple {

when HTTP_REQUEST {
when HTTP_REQUEST priority 100 {
#starts_with "/foo"
if { [regexp {^/foo} [HTTP::uri]] } {
pool foo
Expand Down
14 changes: 13 additions & 1 deletion src/onirule.tcl
Expand Up @@ -51,7 +51,19 @@ proc ::testcl::rule {ruleName body} {
#
# Results:
# None.
proc ::testcl::when {event body} {
proc ::testcl::when args {

if { [llength $args] > 2 } {
# TODO https://devcentral.f5.com/wiki/iRules.when.ashx
puts "Currently ignoring timing and priority in when command"
set event [lindex $args 0]
set body [lindex $args end]
} elseif { [llength $args] < 2 } {
error "wrong # args: see F5 documentation"
} else {
set event [lindex $args 0]
set body [lindex $args 1]
}

variable expectedEvent

Expand Down

0 comments on commit 4fe6e35

Please sign in to comment.