This is an automated email from the ASF dual-hosted git repository.

krisden pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/knox.git


The following commit(s) were added to refs/heads/master by this push:
     new abdb887  KNOX-2258 - Add new rewrite rule in Livy service for handling 
redirect requests to /ui (#276)
abdb887 is described below

commit abdb8874e3cf9b62393a28b14ec0d91f4932f665
Author: Abhishek Shukla <ashu...@hortonworks.com>
AuthorDate: Tue Mar 3 21:14:32 2020 +0530

    KNOX-2258 - Add new rewrite rule in Livy service for handling redirect 
requests to /ui (#276)
---
 .../src/main/resources/services/livy/0.4.0/rewrite.xml            | 4 ++++
 .../src/main/resources/services/livy/0.4.0/service.xml            | 8 ++++++--
 2 files changed, 10 insertions(+), 2 deletions(-)

diff --git 
a/gateway-service-definitions/src/main/resources/services/livy/0.4.0/rewrite.xml
 
b/gateway-service-definitions/src/main/resources/services/livy/0.4.0/rewrite.xml
index fc2fc6c..9241a7c 100644
--- 
a/gateway-service-definitions/src/main/resources/services/livy/0.4.0/rewrite.xml
+++ 
b/gateway-service-definitions/src/main/resources/services/livy/0.4.0/rewrite.xml
@@ -45,4 +45,8 @@
     <rewrite 
template="{$frontend[url]}/yarn/nodemanager/node/containerlogs/{**}?{scheme}?host={$hostmap(host)}?{port}"/>
   </rule>
 
+  <rule dir="OUT" name="LIVYSERVER/livy/outbound/headers/ui" 
pattern="{scheme}://{host}:{port}/ui/">
+    <rewrite template="{$frontend[url]}/livy/ui/"/>
+  </rule>
+
 </rules>
diff --git 
a/gateway-service-definitions/src/main/resources/services/livy/0.4.0/service.xml
 
b/gateway-service-definitions/src/main/resources/services/livy/0.4.0/service.xml
index a1cc470..77c4ebc 100644
--- 
a/gateway-service-definitions/src/main/resources/services/livy/0.4.0/service.xml
+++ 
b/gateway-service-definitions/src/main/resources/services/livy/0.4.0/service.xml
@@ -24,8 +24,12 @@
     </metadata>
   <routes>
     <route path="/livy/**?**"/>
-    <route path="/livy"/>
-    <route path="/livy/"/>
+    <route path="/livy">
+        <rewrite apply="LIVYSERVER/livy/outbound/headers/ui" 
to="response.headers"/>
+    </route>
+    <route path="/livy/">
+        <rewrite apply="LIVYSERVER/livy/outbound/headers/ui" 
to="response.headers"/>
+    </route>
   </routes>
   <dispatch classname="org.apache.knox.gateway.livy.LivyDispatch"/>
 </service>

Reply via email to