diff --git a/server/src/eu/e99/pixelchat/server/ImageHandler.java b/server/src/eu/e99/pixelchat/server/ImageHandler.java index a01a7dc..cd4ddbf 100644 --- a/server/src/eu/e99/pixelchat/server/ImageHandler.java +++ b/server/src/eu/e99/pixelchat/server/ImageHandler.java @@ -1,6 +1,7 @@ package eu.e99.pixelchat.server; import eu.e99.pixelchat.server.storage.Storage; +import io.javalin.http.ContentType; import io.javalin.http.Context; import io.javalin.http.HttpStatus; import org.apache.commons.imaging.ImageFormats; @@ -35,7 +36,10 @@ public class ImageHandler { String id = storage.put(png, expiresAt); logger.info("Stored {} bytes as {}", png.length, id); - ctx.status(HttpStatus.CREATED).result(id); + ctx. + status(HttpStatus.CREATED). + contentType(ContentType.TEXT_PLAIN). + result(id); } public void downloadImage(Context ctx) throws IOException { @@ -46,6 +50,9 @@ public class ImageHandler { return; } - ctx.status(HttpStatus.OK).result(png); + ctx. + status(HttpStatus.OK). + contentType(ContentType.IMAGE_PNG). + result(png); } }