iain-buclaw-sociomantic commented on a change in pull request #399:
URL: https://github.com/apache/knox/pull/399#discussion_r565929389



##########
File path: 
gateway-service-definitions/src/main/resources/services/yarnui/2.7.0/rewrite.xml
##########
@@ -207,7 +207,7 @@
 </filter>
 <filter name="YARNUI/yarn/outbound/filter/cluster">
     <content type="*/html">
-        <apply 
path="(https?://[^/':,]+:[\d]+)?/ws/v1/cluster/apps/application" 
rule="YARNUI/yarn/outbound/apps/cluster1"/>
+        <apply path="https?://[^/':,]+:[\d]+/ws/v1/cluster/apps/application" 
rule="YARNUI/yarn/outbound/apps/cluster1"/>

Review comment:
       So, the following two regexes:
   ```
   (https?://[^/':,]+:[\d]+)?/ws/v1/cluster/apps/application
   /ws/v1/.*
   ```
   Both match the following link of the kill button in YARN.
   ```
   /ws/v1/cluster/apps/application_1611223368889_0003/state
   ```
   You can confirm this here https://regex101.com/r/QkGNeb/1
   
   Because of this, both the `outbound/apps/cluster1` and `outbound/ws1` rules 
got applied on the link, resulting in a broken URL.
   
   What this change does is make `https?://[^/':,]+:[\d]+` an _explicit_ match, 
rather than an optional one, so the `outbound/apps/cluster1` rule will now only 
ever be applied to links in the form of:
   ```
   http://some-internal-domain:1234/ws/v1/cluster/apps/application
   ```




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to