Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id ED9A0200D16 for ; Tue, 10 Oct 2017 13:04:33 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id EC033160BE0; Tue, 10 Oct 2017 11:04:33 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id 3DAB01609E5 for ; Tue, 10 Oct 2017 13:04:33 +0200 (CEST) Received: (qmail 2487 invoked by uid 500); 10 Oct 2017 11:04:32 -0000 Mailing-List: contact issues-help@flink.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@flink.apache.org Delivered-To: mailing list issues@flink.apache.org Received: (qmail 2478 invoked by uid 99); 10 Oct 2017 11:04:32 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd2-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 10 Oct 2017 11:04:32 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd2-us-west.apache.org (ASF Mail Server at spamd2-us-west.apache.org) with ESMTP id B8E591A33E6 for ; Tue, 10 Oct 2017 11:04:31 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd2-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: -4.021 X-Spam-Level: X-Spam-Status: No, score=-4.021 tagged_above=-999 required=6.31 tests=[KAM_LAZY_DOMAIN_SECURITY=1, RCVD_IN_DNSWL_HI=-5, RCVD_IN_MSPIKE_H3=-0.01, RCVD_IN_MSPIKE_WL=-0.01, RP_MATCHES_RCVD=-0.001] autolearn=disabled Received: from mx1-lw-us.apache.org ([10.40.0.8]) by localhost (spamd2-us-west.apache.org [10.40.0.9]) (amavisd-new, port 10024) with ESMTP id Prcl8_AMqqop for ; Tue, 10 Oct 2017 11:04:30 +0000 (UTC) Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by mx1-lw-us.apache.org (ASF Mail Server at mx1-lw-us.apache.org) with SMTP id C844A5FD67 for ; Tue, 10 Oct 2017 11:04:28 +0000 (UTC) Received: (qmail 2435 invoked by uid 99); 10 Oct 2017 11:04:25 -0000 Received: from git1-us-west.apache.org (HELO git1-us-west.apache.org) (140.211.11.23) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 10 Oct 2017 11:04:25 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id 7FD39F56A3; Tue, 10 Oct 2017 11:04:25 +0000 (UTC) From: zentol To: issues@flink.incubator.apache.org Reply-To: issues@flink.incubator.apache.org Message-ID: Subject: [GitHub] flink pull request #4788: [FLINK-7790] [REST] Unresolved query params not ad... Content-Type: text/plain Date: Tue, 10 Oct 2017 11:04:25 +0000 (UTC) archived-at: Tue, 10 Oct 2017 11:04:34 -0000 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 Date: 2017-10-10T10:57:05Z [FLINK-7790] [REST] Unresolved query params not added to request URL ---- ---