[ 
https://issues.apache.org/jira/browse/FLINK-7532?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16171350#comment-16171350
 ] 

ASF GitHub Bot commented on FLINK-7532:
---------------------------------------

Github user zentol commented on a diff in the pull request:

    https://github.com/apache/flink/pull/4601#discussion_r139633588
  
    --- Diff: 
flink-runtime/src/main/java/org/apache/flink/runtime/dispatcher/DispatcherRestEndpoint.java
 ---
    @@ -77,8 +74,11 @@ protected void setupChannelHandlers(Router router, 
CompletableFuture<String> res
                        optWebContent = Optional.empty();
                }
     
    -           optWebContent.ifPresent(
    -                   webContentHandler -> router.GET("/:*", 
webContentHandler));
    +           return optWebContent
    +                   .map(webContent ->
    +                           Collections.singleton(
    +                                   Tuple2.<RestHandlerSpecification, 
ChannelInboundHandler>of(WebContentHandlerSpecification.getInstance(), 
webContent)))
    +                   .orElseGet(() -> Collections.emptySet());
    --- End diff --
    
    Given that we're adding new handlers soon we may want to write things so 
that we can more easily extend the collection it without rewriting most of this 
block.
    
    ```
    Collection<Tuple2<RestHandlerSpecification, ChannelInboundHandler>> result 
= new ArrayList<>();
    optWebContent
        .map(webContent -> result.add(webContent));
    return result;
    ```


> Add StaticFileServerHandler to DispatcherRestEndpoint
> -----------------------------------------------------
>
>                 Key: FLINK-7532
>                 URL: https://issues.apache.org/jira/browse/FLINK-7532
>             Project: Flink
>          Issue Type: Sub-task
>          Components: REST, Webfrontend
>    Affects Versions: 1.4.0
>            Reporter: Till Rohrmann
>            Assignee: Till Rohrmann
>            Priority: Minor
>              Labels: flip-6
>
> The {{DispatcherRestEndpoint}} should be able to server static web content. 
> In order to do that it should instantiate the {{StaticFileServerHandler}} if 
> {{flink-runtime-web}} is in the classpath.



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)

Reply via email to