allow http boolean parameters to accept either "true" or "1" for true
This commit is contained in:
parent
72599ad003
commit
e195ec6295
|
@ -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) {
|
||||
|
|
Loading…
Reference in New Issue