diff --git a/backend/src/main/java/io/papermc/hangar/controller/WellKnownController.java b/backend/src/main/java/io/papermc/hangar/controller/WellKnownController.java index bbf0201bf..a498e7787 100644 --- a/backend/src/main/java/io/papermc/hangar/controller/WellKnownController.java +++ b/backend/src/main/java/io/papermc/hangar/controller/WellKnownController.java @@ -3,19 +3,19 @@ import io.papermc.hangar.HangarComponent; import io.papermc.hangar.security.annotations.Anyone; import org.springframework.http.MediaType; +import org.springframework.http.ResponseEntity; import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RestController; -import org.springframework.web.servlet.ModelAndView; @Anyone @RestController @RequestMapping("/.well-known") public class WellKnownController extends HangarComponent { - @GetMapping(path = "/change-password", produces = MediaType.TEXT_PLAIN_VALUE) - public ModelAndView changePassword() { - return new ModelAndView("redirect:/auth/settings/account"); + @GetMapping(path = "/change-password") + public ResponseEntity changePassword() { + return ResponseEntity.status(301).header("location", "/auth/settings/account").build(); } @GetMapping(path = "/security.txt", produces = MediaType.TEXT_PLAIN_VALUE)