[Minor] don't return default locale, if none is passed by HTTP client

This commit is contained in:
Robert von Burg 2014-12-20 23:20:21 +01:00
parent d1a1b89194
commit 1231eb1f49
1 changed files with 2 additions and 6 deletions

View File

@ -27,12 +27,8 @@ import ch.eitchnet.utils.helper.StringHelper;
public class RestfulHelper {
public static Locale getLocale(HttpHeaders headers) {
Locale locale;
if (headers == null || StringHelper.isEmpty(headers.getHeaderString(HttpHeaders.ACCEPT_LANGUAGE)))
locale = Locale.getDefault();
else
locale = headers.getAcceptableLanguages().get(0);
return locale;
return null;
return headers.getAcceptableLanguages().get(0);
}
}