Test spec for Strict-Transport-Security added
This commit is contained in:
parent
1a6b832295
commit
8892eec62f
1 changed files with 13 additions and 0 deletions
|
|
@ -62,6 +62,19 @@ class HeaderSpec extends FreeSpec with Matchers {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
"Strict-Transport-Security should" - {
|
||||||
|
"provide parseFromValueString method" - {
|
||||||
|
"successful parse run" in {
|
||||||
|
headers.`Strict-Transport-Security`.parseFromValueString("max-age=30; includeSubDomains") shouldEqual Right(headers.`Strict-Transport-Security`(30, true))
|
||||||
|
headers.`Strict-Transport-Security`.parseFromValueString("max-age=30; includeSubDomains; preload") shouldEqual Right(headers.`Strict-Transport-Security`(30, true))
|
||||||
|
}
|
||||||
|
"failing parse run" in {
|
||||||
|
val Left(List(ErrorInfo(summary, detail))) = `Strict-Transport-Security`.parseFromValueString("max-age=30; includeSubDomains; preload;")
|
||||||
|
summary shouldEqual "Illegal HTTP header 'Strict-Transport-Security': Invalid input 'EOI', expected OWS or token0 (line 1, column 40)"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
"All request headers should" - {
|
"All request headers should" - {
|
||||||
|
|
||||||
"render in request" in {
|
"render in request" in {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue