From 1a0874e233e46bcae74c68056e2fdc54b42ab934 Mon Sep 17 00:00:00 2001 From: Thibault Duplessis Date: Fri, 15 Jun 2012 23:53:58 +0200 Subject: [PATCH] tolerate white spaces in request accepted languages header --- app/i18n/I18nPool.scala | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/i18n/I18nPool.scala b/app/i18n/I18nPool.scala index 2b1d6522ef..c34fe239d0 100644 --- a/app/i18n/I18nPool.scala +++ b/app/i18n/I18nPool.scala @@ -23,7 +23,7 @@ final class I18nPool(val langs: Set[Lang], val default: Lang) { // when the header is malformed. def fixedReqAcceptLanguages(req: RequestHeader) = try { req.headers.get(play.api.http.HeaderNames.ACCEPT_LANGUAGE).map { acceptLanguage ⇒ - acceptLanguage.split(",").map(l ⇒ play.api.i18n.Lang(l.split(";").head)).toSeq + acceptLanguage.split("\\s*,\\s*").map(l => play.api.i18n.Lang(l.split(";").head)).toSeq }.getOrElse(Nil) } catch {