You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I was using the content type "text/html;charset=utf-8". The string matches the requirement on line 340 but then fails to parse because there is no space after the semicolon. Rather than a Some("utf-8") or a None, the function returns a Some(""). This causes an error somewhere down the line which is quite difficult to trace.
The spec for content-type/charset does not require a space after the semicolon. I would suggest something like the following:
header(CONTENT_TYPE, of) match {
caseSome(s) =>valparts= s.split(";\\s*charset=")
if (parts.size >1) Some(parts.drop(1).mkString.trim) elseNonecase _ =>None
}
The text was updated successfully, but these errors were encountered:
Referring to this line: https://github.com/playframework/playframework/blob/2.3.x/framework/src/play-test/src/main/scala/play/api/test/Helpers.scala#L340
I was using the content type
"text/html;charset=utf-8"
. The string matches the requirement on line 340 but then fails to parse because there is no space after the semicolon. Rather than aSome("utf-8")
or aNone
, the function returns aSome("")
. This causes an error somewhere down the line which is quite difficult to trace.The spec for content-type/charset does not require a space after the semicolon. I would suggest something like the following:
The text was updated successfully, but these errors were encountered: