summaryrefslogtreecommitdiff
path: root/server/src
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/src
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/src')
-rw-r--r--server/src/net/usebox/gemini/server/Server.scala4
1 files changed, 3 insertions, 1 deletions
diff --git a/server/src/net/usebox/gemini/server/Server.scala b/server/src/net/usebox/gemini/server/Server.scala
index ce840df..5b1692f 100644
--- a/server/src/net/usebox/gemini/server/Server.scala
+++ b/server/src/net/usebox/gemini/server/Server.scala
@@ -72,7 +72,9 @@ case class Server(conf: ServiceConf) {
uri.getScheme(),
uri.getHost(),
uri.getPath().decode(),
- vHosts.find(_.host == uri.getHost().toLowerCase)
+ vHosts.find(vh =>
+ Some(vh.host) == Option(uri.getHost()).map(_.toLowerCase)
+ )
) match {
case (null, _, _, _) =>
logger.debug(s"no scheme")