You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pulsar.apache.org by mm...@apache.org on 2018/03/27 17:19:01 UTC

[incubator-pulsar] branch master updated: Fix: NPE on http-lookup redirection (#1451)

This is an automated email from the ASF dual-hosted git repository.

mmerli pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-pulsar.git


The following commit(s) were added to refs/heads/master by this push:
     new 4bf44d9  Fix: NPE on http-lookup redirection (#1451)
4bf44d9 is described below

commit 4bf44d98cb2744d7a314f8bc9b96113f6775e04a
Author: Rajan Dhabalia <rd...@apache.org>
AuthorDate: Tue Mar 27 10:18:59 2018 -0700

    Fix: NPE on http-lookup redirection (#1451)
---
 .../src/main/java/org/apache/pulsar/broker/web/PulsarWebResource.java | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/pulsar-broker/src/main/java/org/apache/pulsar/broker/web/PulsarWebResource.java b/pulsar-broker/src/main/java/org/apache/pulsar/broker/web/PulsarWebResource.java
index bae1019..b6e7481 100644
--- a/pulsar-broker/src/main/java/org/apache/pulsar/broker/web/PulsarWebResource.java
+++ b/pulsar-broker/src/main/java/org/apache/pulsar/broker/web/PulsarWebResource.java
@@ -42,6 +42,7 @@ import javax.ws.rs.core.Response.Status;
 import javax.ws.rs.core.UriBuilder;
 import javax.ws.rs.core.UriInfo;
 
+import org.apache.commons.lang3.StringUtils;
 import org.apache.pulsar.broker.PulsarService;
 import org.apache.pulsar.broker.ServiceConfiguration;
 import org.apache.pulsar.broker.admin.AdminResource;
@@ -264,7 +265,8 @@ public abstract class PulsarWebResource {
 
     private URI getRedirectionUrl(ClusterData differentClusterData) throws MalformedURLException {
         URL webUrl = null;
-        if (pulsar.getConfiguration().isTlsEnabled() && !differentClusterData.getServiceUrlTls().isEmpty()) {
+        if (isRequestHttps() && pulsar.getConfiguration().isTlsEnabled()
+                && StringUtils.isNotBlank(differentClusterData.getServiceUrlTls())) {
             webUrl = new URL(differentClusterData.getServiceUrlTls());
         } else {
             webUrl = new URL(differentClusterData.getServiceUrl());

-- 
To stop receiving notification emails like this one, please contact
mmerli@apache.org.