Open
Description
Consider an app with the following server.recon
file:
tutorial: @fabric {
@plane(class: "swim.tutorial.TutorialPlane")
}
@web(port: 9001) {
space: "tutorial"
documentRoot: "./ui/"
@websocket {
serverCompressionLevel: 0# -1 = default; 0 = off; 1-9 = deflate level
clientCompressionLevel: 0# -1 = default; 0 = off; 1-9 = deflate level
}
}
If this app is installed in a folder say: /home/user name/abc
then it will fail with the following exception when it is run:
--> :1:28
|
1 | /home/user name/abc
|
at swim.codec/swim.codec.Parser.error(Parser.java:142)
at swim.uri/swim.uri.UriParser.parsePathString(UriParser.java:214)
at swim.uri/swim.uri.UriPath.parse(UriPath.java:314)
at swim.service.web/swim.service.web.WebServer.<init>(WebServer.java:62)
at swim.service.web/swim.service.web.WebService.createServer(WebService.java:118)
at swim.io.http/swim.io.http.HttpSocketService.createSocket(HttpSocketService.java:51)
at swim.io/swim.io.TcpService.doAccept(TcpService.java:117)
at swim.io/swim.io.StationTransport.doAccept(Station.java:453)
at swim.io/swim.io.StationThread.doAccept(Station.java:1079)
at swim.io/swim.io.StationThread.select(Station.java:1005)
at swim.io/swim.io.StationThread.run(Station.java:882)
Note that this issue applies only for apps that have a DocumentRoot
in the recon configuration file.
This occurs because the File's absolute path gets parsed into a Uri object which fails if the file path of the DocumentRoot has characters that aren't compliant with the URI syntax.
A possible solution would be to URI encode the absolute path of the File