Hello Priyanka,

Sometimes the content types do not match, can you check if the response
type you are getting back is indeed "application/javascript" ?
Also, try using a broader rule on service.xml for testing something like /
Do you see any failures in gateway.log, i.e. failure to apply rules etc.

On Thu, Aug 16, 2018 at 3:40 AM Priyanka Gupta <priyanka.gu...@guavus.com>
wrote:

> Hi,
>
> I need some help on a rewrite rule.I have a java script which is internally 
> calling other java scripts.So I tried to modify the url of those javascript 
> using filters.
>
> Java scripts url : </cdap_assets/img/cdap_logo.png>
>
>
> But these requests are not changing.
>
>
>     <rule dir="OUT" name="CDAPUI/cdapui/outbound/imgs" pattern="img/{**}">
>         <rewrite template="{$frontend[path]}/cdapui/cdap_assets/img/{**}"/>
>     </rule>
>
>     <rule dir="OUT" name="CDAPUI/cdapui/outbound/img">
>         <rewrite template="cdapui/cdap_assets/img/cdap_logo.png"/>
>     </rule>
>
>     <filter name="CDAPUI/cdapui/outbound/app">
>     <content type="application/javascript">
>         <apply path="/cdap_assets/img/cdap_logo.png" 
> rule="CDAPUI/cdapui/outbound/img"/>
>     </content>
>     </filter>
>
>
> Also, I tied the rule to service.xml like:
>
>     <routes>
>         <route path="/cdapui/**">
>             <rewrite apply="CDAPUI/cdapui/outbound/app" to="response.body"/>
>         </route>
>     </routes>
>
>
> Thanks in advance!
>
>
>
>
>
>
>
>

Reply via email to