allow http boolean parameters to accept either "true" or "1" for true

This commit is contained in:
kimchy 2010-02-18 23:09:05 +02:00
parent 72599ad003
commit e195ec6295
1 changed files with 1 additions and 5 deletions

View File

@ -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) {