Skip to content

Commit

Permalink
Fix load of workspace (#411)
Browse files Browse the repository at this point in the history
  • Loading branch information
vorburger authored and edewit committed Aug 26, 2022
1 parent 8a69e72 commit ff8206b
Showing 1 changed file with 6 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,8 @@
*
* @author Michael Vorburger.ch
*/
@Singleton public class StaticWebServerVerticle extends AbstractHttpServerVerticle {
@Singleton
public class StaticWebServerVerticle extends AbstractHttpServerVerticle {

private static final Logger LOG = LoggerFactory.getLogger(StaticWebServerVerticle.class);

Expand All @@ -78,8 +79,8 @@
throw new UncheckedIOException(e);
}

JWTAuthOptions authConfig = new JWTAuthOptions().addPubSecKey(
new PubSecKeyOptions().setAlgorithm("HS256").setBuffer("keyboard cat"));
JWTAuthOptions authConfig = new JWTAuthOptions()
.addPubSecKey(new PubSecKeyOptions().setAlgorithm("HS256").setBuffer("keyboard cat"));

JWTAuth authProvider = JWTAuth.create(vertx, authConfig);

Expand Down Expand Up @@ -140,7 +141,8 @@
final String playerUUID = ctx.user().get("playerUUID");
final Path workspaceFile = workspace.resolve(playerUUID);
if (java.nio.file.Files.exists(workspaceFile)) {
ctx.response().sendFile(workspace.toString());
final String fileName = workspaceFile.toString();
ctx.response().sendFile(fileName).onFailure(t -> LOG.error("sendFile('{}') failed", fileName, t));
} else {
ctx.fail(404);
}
Expand Down

0 comments on commit ff8206b

Please sign in to comment.