From 58d2aec7c8e6d1710a8e0a370920bf4096a4ebc4 Mon Sep 17 00:00:00 2001 From: "Juan J. Martinez" Date: Wed, 24 Nov 2021 19:49:08 +0000 Subject: Empty URLs are invalid Take this into account whe converting the host to lower case. --- server/test/src/ServerSpec.scala | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'server/test/src') 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( -- cgit v1.2.3