From e195ec6295763b7102ee4f08628b631e550546bf Mon Sep 17 00:00:00 2001 From: kimchy Date: Thu, 18 Feb 2010 23:09:05 +0200 Subject: [PATCH] allow http boolean parameters to accept either "true" or "1" for true --- .../java/org/elasticsearch/http/netty/NettyHttpRequest.java | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/modules/elasticsearch/src/main/java/org/elasticsearch/http/netty/NettyHttpRequest.java b/modules/elasticsearch/src/main/java/org/elasticsearch/http/netty/NettyHttpRequest.java index 455b0f1db9b..6aa3dd9152e 100644 --- a/modules/elasticsearch/src/main/java/org/elasticsearch/http/netty/NettyHttpRequest.java +++ b/modules/elasticsearch/src/main/java/org/elasticsearch/http/netty/NettyHttpRequest.java @@ -128,11 +128,7 @@ public class NettyHttpRequest implements HttpRequest { if (sValue == null) { return defaultValue; } - try { - return Boolean.valueOf(sValue); - } catch (NumberFormatException e) { - throw new ElasticSearchIllegalArgumentException("Failed to parse boolean parameter [" + key + "] with value [" + sValue + "]", e); - } + return sValue.equals("true") || sValue.equals("1"); } @Override public String param(String key) {