liubao68 commented on a change in pull request #1458: [SCB-1407] handler-router 
decoupled spi/rename package
URL: 
https://github.com/apache/servicecomb-java-chassis/pull/1458#discussion_r358688789
 
 

 ##########
 File path: 
handlers/handler-router/src/main/java/org/apache/servicecomb/router/custom/RouterServerListFilter.java
 ##########
 @@ -57,11 +58,22 @@ public boolean enabled() {
       Invocation invocation) {
     String targetServiceName = invocation.getMicroserviceName();
     Map<String, String> headers = addHeaders(invocation);
+    filterHeaders(headers);
     return RouterFilter
         .getFilteredListOfServers(list, targetServiceName, headers,
             distributer);
   }
 
+  private void filterHeaders(Map<String, String> headers) {
+    List<RouterHeaderFilterExt> filters = SPIServiceUtils
+        .loadSortedService(RouterHeaderFilterExt.class);
+    for (RouterHeaderFilterExt filterExt : filters) {
+      if (filterExt.enabled()) {
+        headers = filterExt.doFilter(headers);
 
 Review comment:
   headers can not be changed by this code

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


With regards,
Apache Git Services

Reply via email to