Skip to content

Commit

Permalink
Fix #9387
Browse files Browse the repository at this point in the history
  • Loading branch information
gregw committed Feb 16, 2023
1 parent 0ca6295 commit af78d13
Showing 1 changed file with 2 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@
import java.net.SocketAddress;
import java.nio.ByteBuffer;
import java.nio.charset.Charset;
import java.util.Collections;
import java.util.List;
import java.util.Locale;
import java.util.function.Function;
Expand Down Expand Up @@ -113,7 +112,6 @@
*/
public interface Request extends Attributes, Content.Source
{
List<Locale> __defaultLocale = Collections.singletonList(Locale.getDefault());
String CACHE_ATTRIBUTE = Request.class.getCanonicalName() + ".CookieCache";
String COOKIE_ATTRIBUTE = Request.class.getCanonicalName() + ".Cookies";

Expand Down Expand Up @@ -382,13 +380,13 @@ static List<Locale> getLocales(Request request)
{
HttpFields fields = request.getHeaders();
if (fields == null)
return __defaultLocale;
return List.of(Locale.getDefault());

List<String> acceptable = fields.getQualityCSV(HttpHeader.ACCEPT_LANGUAGE);

// handle no locale
if (acceptable.isEmpty())
return __defaultLocale;
return List.of(Locale.getDefault());

return acceptable.stream().map(language ->
{
Expand Down

0 comments on commit af78d13

Please sign in to comment.