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

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

GitHub user zentol opened a pull request:

    https://github.com/apache/flink/pull/4788

    [FLINK-7790] [REST] Unresolved query params not added to request URL

    ## What is the purpose of the change
    
    This PR fixes a bug where unresolved optional parameters where still 
included in the request URL by the RestClusterClient.
    
    For example, imagine a request to list the current jobs, with an optional 
query parameter "state" to select only running/completed jobs. If this 
parameter was unresolved (aka no explicit value was set for it by the client), 
this currently causes the request URL to look like this: "/jobs?state=null", 
whereas it should be "/jobs",
    
    This is caused by a faulty check in `MessageParameters#resolveUrl` that 
constructs the request URL from a set of parameters. It did not properly verify 
whether a query was resolved before adding it to the URL.
    
    ## Brief change log
    
    * fix the bug
    * add a test
    
    ## Verifying this change
    
    This change added tests and can be verified as follows:
    
    * run `MessageParametersTest#testUnresolvedParameters`


You can merge this pull request into a Git repository by running:

    $ git pull https://github.com/zentol/flink 7790

Alternatively you can review and apply these changes as the patch at:

    https://github.com/apache/flink/pull/4788.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

    This closes #4788
    
----
commit d606aa8a4f5f60a03bda5a0f82cdbb4e5bea329f
Author: zentol <[email protected]>
Date:   2017-10-10T10:57:05Z

    [FLINK-7790] [REST] Unresolved query params not added to request URL

----


> Unresolved query parameters are not omitted from request
> --------------------------------------------------------
>
>                 Key: FLINK-7790
>                 URL: https://issues.apache.org/jira/browse/FLINK-7790
>             Project: Flink
>          Issue Type: Bug
>          Components: REST
>    Affects Versions: 1.4.0
>            Reporter: Chesnay Schepler
>            Assignee: Chesnay Schepler
>             Fix For: 1.4.0
>
>




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

Reply via email to