Skip to content

Commit

Permalink
Merge pull request #131 from softwaremill/test-invalid-cookie
Browse files Browse the repository at this point in the history
Test verifying cookie parsing with control characters
  • Loading branch information
adamw authored Oct 27, 2021
2 parents 737967a + 8a073c2 commit 5f771ad
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions core/src/test/scalajvm/sttp/model/headers/CookieTest.scala
Original file line number Diff line number Diff line change
Expand Up @@ -121,4 +121,8 @@ class CookieTest extends AnyFlatSpec with Matchers {
CookieWithMeta("a", "b").value shouldBe "b"
CookieWithMeta("a", CookieValueWithMeta.unsafeApply("b")).value shouldBe "b"
}

it should "not create a cookie containing control characters" in {
Cookie.parse("x=y\ra=b") shouldBe Left("Cookie value can not contain control characters")
}
}

0 comments on commit 5f771ad

Please sign in to comment.