summaryrefslogtreecommitdiff
path: root/server/test/src/ServerSpec.scala
diff options
context:
space:
mode:
authorJuan J. Martinez <jjm@usebox.net>2021-11-24 19:49:08 +0000
committerJuan J. Martinez <jjm@usebox.net>2021-11-24 19:49:08 +0000
commit58d2aec7c8e6d1710a8e0a370920bf4096a4ebc4 (patch)
tree3072cc15a27c7781b6d87b6a7cea5a6cd03d7a34 /server/test/src/ServerSpec.scala
parent5cdf680f9bad61cfff3defd67420c3d56e848036 (diff)
downloadspacebeans-58d2aec7c8e6d1710a8e0a370920bf4096a4ebc4.tar.gz
spacebeans-58d2aec7c8e6d1710a8e0a370920bf4096a4ebc4.zip
Empty URLs are invalid
Take this into account whe converting the host to lower case.
Diffstat (limited to 'server/test/src/ServerSpec.scala')
-rw-r--r--server/test/src/ServerSpec.scala7
1 files changed, 7 insertions, 0 deletions
diff --git a/server/test/src/ServerSpec.scala b/server/test/src/ServerSpec.scala
index c9a6947..dd6bf20 100644
--- a/server/test/src/ServerSpec.scala
+++ b/server/test/src/ServerSpec.scala
@@ -171,6 +171,13 @@ class ServerSpec extends AnyFlatSpec with Matchers {
)
}
+ it should "return bad request on empty URLs" in {
+ Server(TestData.conf)
+ .handleReq("", "127.0.0.1") should be(
+ a[BadRequest]
+ )
+ }
+
it should "return bad request when the path is out of root dir" in {
Server(TestData.conf)
.handleReq("gemini://localhost/../../", "127.0.0.1") should be(