aboutsummaryrefslogtreecommitdiff
path: root/server/test
diff options
context:
space:
mode:
Diffstat (limited to 'server/test')
-rw-r--r--server/test/src/ServerSpec.scala24
1 files changed, 24 insertions, 0 deletions
diff --git a/server/test/src/ServerSpec.scala b/server/test/src/ServerSpec.scala
index ea40798..c9a6947 100644
--- a/server/test/src/ServerSpec.scala
+++ b/server/test/src/ServerSpec.scala
@@ -152,6 +152,11 @@ class ServerSpec extends AnyFlatSpec with Matchers {
.handleReq("gemini://localhost:8080/", "127.0.0.1") should be(a[Success])
}
+ it should "handle host case insensitive" in {
+ Server(TestData.conf)
+ .handleReq("gemini://LOCALHOST/", "127.0.0.1") should be(a[Success])
+ }
+
it should "return proxy request refused when the vhost is not found" in {
Server(TestData.conf)
.handleReq("gemini://otherhost/", "127.0.0.1") should be(
@@ -461,6 +466,25 @@ class ServerSpec extends AnyFlatSpec with Matchers {
}
}
+ it should "execute a CGI: host is case-insensitive and the value in the conf is used" in {
+ Server(TestData.cgiConf).handleReq(
+ "gemini://LOCALHOST/dir/cgi",
+ "127.0.0.1"
+ ) should matchPattern {
+ case Cgi(
+ _,
+ _,
+ "",
+ "",
+ "cgi",
+ TestData.host,
+ TestData.portStr,
+ _,
+ _
+ ) =>
+ }
+ }
+
it should "execute a CGI: query string" in {
Server(TestData.cgiConf).handleReq(
"gemini://localhost/dir/cgi?query&string",