I am trying to verify that a URI rewrite is occuring -- Is it expected that you are unable to overwrite a field that you already set in the test with an iRule? For example:
iRule:
rule simple {
when HTTP_REQUEST {
HTTP::uri "/foobar"
}
}
Test:
it "rewrite example" {
event HTTP_REQUEST
on HTTP::uri return "/foo"
verify "URI is rewritten to" "/foobar" eq {HTTP::uri}
run resources/simple_irule.tcl simple
}
in the debug, it looks like the value is getting set
debug HTTP::uri set: /foobar
However, when the verify executes it goes back to what was set in the on
info Returning value '/foo' for procedure call 'HTTP::uri'
error Verification 'URI is rewritten to' failed - expression: {/foobar} eq {/foo}
I know there is an issue trying to overwrite when using before statements, but wasn't sure if it was possible in the actual iRule. Any help would be much appreciated!
I am trying to verify that a URI rewrite is occuring -- Is it expected that you are unable to overwrite a field that you already set in the test with an iRule? For example:
iRule:
Test:
in the debug, it looks like the value is getting set
debug HTTP::uri set: /foobarHowever, when the verify executes it goes back to what was set in the on
info Returning value '/foo' for procedure call 'HTTP::uri'error Verification 'URI is rewritten to' failed - expression: {/foobar} eq {/foo}I know there is an issue trying to overwrite when using before statements, but wasn't sure if it was possible in the actual iRule. Any help would be much appreciated!