fix basic authentication for systems with turkish locale

This commit is contained in:
Sebastian Sdorra
2012-06-28 14:54:44 +02:00
parent 1cdf666c71
commit a8b3b3bb27
2 changed files with 19 additions and 2 deletions

View File

@@ -47,6 +47,7 @@ import java.util.Comparator;
import java.util.Date;
import java.util.Iterator;
import java.util.List;
import java.util.Locale;
import java.util.Map;
import java.util.TimeZone;
@@ -398,6 +399,23 @@ public class Util
return parseDate(dateString, null);
}
/**
* Method description
*
*
* @param value
* @param start
*
* @return
*
* @since 1.17
*/
public static boolean startWithIgnoreCase(String value, String start)
{
return (value != null) && (start != null)
&& value.toUpperCase(Locale.ENGLISH).startsWith(start);
}
/**
* Method description
*

View File

@@ -120,8 +120,7 @@ public class BasicAuthenticationFilter extends HttpFilter
User user = null;
String authentication = request.getHeader(HEADER_AUTHORIZATION);
if (Util.isNotEmpty(authentication)
&& authentication.toUpperCase().startsWith(AUTHORIZATION_BASIC_PREFIX))
if (Util.startWithIgnoreCase(authentication, AUTHORIZATION_BASIC_PREFIX))
{
if (logger.isTraceEnabled())
{