From 11079ea57287bfb5fdca0f962351f6f0d7819f05 Mon Sep 17 00:00:00 2001 From: Liam Date: Wed, 10 Apr 2024 12:08:12 +0100 Subject: [PATCH] update hostnameAndPort to be hostname --- .../cc.fascinated/controller/ServerController.java | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/src/main/java/cc.fascinated/controller/ServerController.java b/src/main/java/cc.fascinated/controller/ServerController.java index 26722e5..8061b55 100644 --- a/src/main/java/cc.fascinated/controller/ServerController.java +++ b/src/main/java/cc.fascinated/controller/ServerController.java @@ -30,21 +30,21 @@ public class ServerController { } @ResponseBody - @GetMapping(value = "/{platform}/{hostnameAndPort}", produces = MediaType.APPLICATION_JSON_VALUE) + @GetMapping(value = "/{platform}/{hostname}", produces = MediaType.APPLICATION_JSON_VALUE) public CachedMinecraftServer getServer( @Parameter(description = "The platform of the server", example = "java") @PathVariable String platform, - @Parameter(description = "The hostname and port of the server", example = "play.hypixel.net") @PathVariable String hostnameAndPort) { - Tuple host = ServerUtils.getHostnameAndPort(hostnameAndPort); + @Parameter(description = "The hostname and port of the server", example = "play.hypixel.net") @PathVariable String hostname) { + Tuple host = ServerUtils.getHostnameAndPort(hostname); return serverService.getServer(platform, host.getLeft(), host.getRight()); } @ResponseBody - @GetMapping(value = "/icon/{hostnameAndPort}", produces = MediaType.IMAGE_PNG_VALUE) + @GetMapping(value = "/icon/{hostname}", produces = MediaType.IMAGE_PNG_VALUE) public ResponseEntity getServerIcon( - @Parameter(description = "The hostname and port of the server", example = "play.hypixel.net") @PathVariable String hostnameAndPort, + @Parameter(description = "The hostname and port of the server", example = "play.hypixel.net") @PathVariable String hostname, @Parameter(description = "Whether to download the image") @RequestParam(required = false, defaultValue = "false") boolean download) { - Tuple host = ServerUtils.getHostnameAndPort(hostnameAndPort); - String hostname = host.getLeft(); + Tuple host = ServerUtils.getHostnameAndPort(hostname); + hostname = host.getLeft(); int port = host.getRight(); String dispositionHeader = download ? "attachment; filename=%s.png" : "inline; filename=%s.png";