on 02-16-2016 2:11 PM
Hi,
how can I define the following if-statement in SAP-Web Dispatcher modification handler, so that I can use a combination of OR and AND.
So the statement below is what I want, so I am looking for the "bracket" functionality, where I don't know how to realize this.
Kind regards
if %{HTTP_HOST} regimatch <host>.* [and]
( If %{REMOTE_ADDR} regimatch ^<ip1>.* [or]
If %{REMOTE_ADDR} regimatch ^<ip2>.* [or]
If %{REMOTE_ADDR} regimatch ^<ip3>.* ) [and]
if %{PATH} regimatch "^/<name of page>"
SetHeader x-sap-webdisp-target-sid <ID> [break]
Hello,
That would already be the correct feature.
See the following SAP Help page.
Regards,
Isaías
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hello,
Not necessarily.
I believe that something like the below should work (notice I changed the order of the conditions).
if %{HTTP_HOST} regimatch <host>.* [and]
if %{PATH} regimatch "^/<name of page>" [or]
if %{REMOTE_ADDR} regimatch ^<ip1>.* [or]
if %{REMOTE_ADDR} regimatch ^<ip2>.* [or]
if %{REMOTE_ADDR} regimatch ^<ip3>.*
SetHeader x-sap-webdisp-target-sid <ID> [break]
Regards,
Isaías
Hello,
Now I realize there is a mistake in the example I sent. It should be:
if %{HTTP_HOST} regimatch <host>.* [and]
if %{PATH} regimatch "^/<name of page>" [and]
if %{REMOTE_ADDR} regimatch ^<ip1>.* [or]
if %{REMOTE_ADDR} regimatch ^<ip2>.* [or]
if %{REMOTE_ADDR} regimatch ^<ip3>.*
SetHeader x-sap-webdisp-target-sid <ID> [break]
As the SAP Help page I sent states, there "and" and "or" operators have equal precedence.
This means that the Web Dispatcher will not perform all "and's" before all "or's", for example.
The operations (and/or) will be applied from the first to the last (or from left to right), in the order they appear in your rule.
So, I believe that the Web Dispatcher will first test
%{HTTP_HOST} regimatch <host>.*
If this is true, it will test the next condition (%{PATH} regimatch "^/<name of page>") and perform an "and" operation (both must be true).
It will then perform an "and" with the next condition, which is followed by an "or" operation...
I am not quite sure how it would proceed as of this point. You would need to test this.
Regards,
Isaías
User | Count |
---|---|
87 | |
10 | |
10 | |
10 | |
7 | |
6 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.