=htp #17985 fix content negotiation assuming charsetRanges being List in pattern match

(cherry picked from commit 76cc4d890c3b7ea3a5510656520c20b165090adb)
This commit is contained in:
Johannes Rudolph 2015-07-14 13:08:54 +02:00
parent e3ae7abb3b
commit 5ba7918cd9
3 changed files with 9 additions and 1 deletions

View file

@ -53,6 +53,13 @@ class ContentNegotiationSpec extends FreeSpec with Matchers {
accept(`text/plain` withCharset `UTF-8`) should reject
}
"manually created Accept-Charset: UTF-16" in testHeaders(headers.`Accept-Charset`(Vector(HttpCharsets.`UTF-16`.toRange))) { accept
accept(`text/plain`) should select(`text/plain`, `UTF-16`)
// FIXME: reenable, currently fails because of #17984
// accept(`text/plain` withCharset `UTF-8`) should reject
}
"Accept-Charset: UTF-16, UTF-8" test { accept
accept(`text/plain`) should select(`text/plain`, `UTF-8`)
accept(`text/plain` withCharset `UTF-16`) should select(`text/plain`, `UTF-16`)