Ignore empty Accept-Language header value

Issue: SPR-15603
This commit is contained in:
Rossen Stoyanchev
2017-05-31 21:10:08 -04:00
parent b494c53b40
commit e81651b657
2 changed files with 7 additions and 1 deletions

View File

@@ -467,7 +467,7 @@ public class HttpHeaders implements MultiValueMap<String, String>, Serializable
*/
public List<Locale.LanguageRange> getAcceptLanguage() {
String value = getFirst(ACCEPT_LANGUAGE);
return value != null ? Locale.LanguageRange.parse(value) : Collections.emptyList();
return StringUtils.hasText(value) ? Locale.LanguageRange.parse(value) : Collections.emptyList();
}
/**