How to set origin value or referer value in a response-header using tuckey url rewrite filter xml file.
Accessing %{origin}
directly in the set tag is not working but not working in condition tag.
Below is the example I tried.
<rule enabled="true" last="false" match-type="regex">
<name>Enabling CORS Headers</name>
<from>^/path/someMorePath.*$</from>
<condition name="origin" operator="equal">http://www.testsite.com</condition> <!-- would like to write some regex to match a set of sites and if matched, then set the same origin as response -->
<set type="response-header" name="Access-Control-Allow-Origin">%{origin}</set>
<set type="response-header" name="Access-Control-Allow-Credentials">true</set>
</rule>
After having an complete understanding on the urlrewritefilter of tuckey api, the solution is to have a regular expression.
So, here using the regular expression in the condition tag and then using the back references in the regular expression as the variables in the response header