summaryrefslogtreecommitdiff
path: root/server/src/net
diff options
context:
space:
mode:
authorJuan J. Martinez <jjm@usebox.net>2021-02-26 10:45:00 +0000
committerJuan J. Martinez <jjm@usebox.net>2021-07-22 19:49:48 +0100
commitb2d82bddd39d61c81ce14086809d817a1475e0b5 (patch)
tree0a0e233a2f134abd2da44eece02fc16ffd382dd7 /server/src/net
parent2149d073ddb557ad70d2aa0a86289653530e5986 (diff)
downloadspacebeans-b2d82bddd39d61c81ce14086809d817a1475e0b5.tar.gz
spacebeans-b2d82bddd39d61c81ce14086809d817a1475e0b5.zip
Support for JDK 8 (and 11)
Diffstat (limited to 'server/src/net')
-rw-r--r--server/src/net/usebox/gemini/server/Server.scala8
1 files changed, 5 insertions, 3 deletions
diff --git a/server/src/net/usebox/gemini/server/Server.scala b/server/src/net/usebox/gemini/server/Server.scala
index c2fcee3..ed9252d 100644
--- a/server/src/net/usebox/gemini/server/Server.scala
+++ b/server/src/net/usebox/gemini/server/Server.scala
@@ -3,8 +3,7 @@ package net.usebox.gemini.server
import java.nio.charset.Charset
import javax.net.ssl.SSLEngine
import java.net.URI
-import java.nio.file.Path
-import java.nio.file.Files
+import java.nio.file.{Path, FileSystems, Files}
import scala.util.{Try, Success => TrySuccess}
@@ -102,7 +101,10 @@ case class Server(conf: ServiceConf) {
logger.debug("redirect to normalize uri")
PermanentRedirect(req, uri.normalize().toString())
case ("gemini", host, path, Some(vhost)) =>
- val resource = Path.of(vhost.root, path).normalize()
+ val resource = FileSystems
+ .getDefault()
+ .getPath(vhost.root, path)
+ .normalize()
logger.debug(s"requesting: '$resource'")