xianjingfeng commented on code in PR #1449:
URL: 
https://github.com/apache/incubator-uniffle/pull/1449#discussion_r1452064472


##########
dashboard/src/main/java/org/apache/uniffle/dashboard/web/proxy/WebProxyServlet.java:
##########
@@ -28,21 +29,24 @@
 
 public class WebProxyServlet extends ProxyServlet {
 
-  private String targetAddress;
-
   private static final Logger LOG = 
LoggerFactory.getLogger(WebProxyServlet.class);
 
-  public WebProxyServlet(String targetAddress) {
-    this.targetAddress = targetAddress;
+  private Map<String, String> serverAddressesMap;
+
+  public WebProxyServlet(Map<String, String> serverAddressesMap) {
+    this.serverAddressesMap = serverAddressesMap;
   }
 
   @Override
   protected String rewriteTarget(HttpServletRequest clientRequest) {
     if (!validateDestination(clientRequest.getServerName(), 
clientRequest.getServerPort())) {
       return null;
     }
+    String targetAddress = 
serverAddressesMap.get(clientRequest.getHeader("targetAddress"));
+    if (targetAddress == null) {
+      targetAddress = "http://localhost:19997/";;

Review Comment:
   I don't think we should handle this unexpected situation. because the 
protocol, host and port are not fixed. 



-- 
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.

To unsubscribe, e-mail: [email protected]

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


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to