From eb10679ed6a7f7a9d7a41416a118c1b88ff9decd Mon Sep 17 00:00:00 2001 From: Mathias Date: Mon, 30 Mar 2015 13:30:59 +0200 Subject: [PATCH] =htc #16809 add testing proving absence of issue spray/spray#1006 --- .../test/scala/akka/http/model/parser/HttpHeaderSpec.scala | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/akka-http-core/src/test/scala/akka/http/model/parser/HttpHeaderSpec.scala b/akka-http-core/src/test/scala/akka/http/model/parser/HttpHeaderSpec.scala index 7191378df8..e719d28e1d 100644 --- a/akka-http-core/src/test/scala/akka/http/model/parser/HttpHeaderSpec.scala +++ b/akka-http-core/src/test/scala/akka/http/model/parser/HttpHeaderSpec.scala @@ -143,6 +143,10 @@ class HttpHeaderSpec extends FreeSpec with Matchers { Authorization(OAuth2BearerToken("mF_9.B5f-4.1JqM/")) "Authorization: NoParamScheme" =!= Authorization(GenericHttpCredentials("NoParamScheme", Map.empty[String, String])) + "Authorization: QVFJQzV3TTJMWTRTZmN3Zk=" =!= + ErrorInfo("Illegal HTTP header 'Authorization': Invalid input '=', expected tchar, '\\r', WSP, token68-start or 'EOI' (line 1, column 23)", + """QVFJQzV3TTJMWTRTZmN3Zk= + | ^""".stripMargin) } "Cache-Control" in { @@ -551,7 +555,8 @@ class HttpHeaderSpec extends FreeSpec with Matchers { implicit class TestError(expectedError: ErrorInfo) extends TestExample { def apply(line: String) = { val Array(name, value) = line.split(": ", 2) - HttpHeader.parse(name, value) should matchPattern { case HttpHeader.ParsingResult.Ok(_, `expectedError` :: Nil) ⇒ } + val HttpHeader.ParsingResult.Ok(_, error :: Nil) = HttpHeader.parse(name, value) + error shouldEqual expectedError } }