From d2bb14ae5d199b9f170b6061349591361bcdcdf9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=B4me=20Bourgeois?= Date: Tue, 27 Feb 2024 15:19:27 +0100 Subject: [PATCH] Fix: Update https --- .../java/fr/insee/rmes/config/ApplicationContext.java | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/main/java/fr/insee/rmes/config/ApplicationContext.java b/src/main/java/fr/insee/rmes/config/ApplicationContext.java index 1c771e9..51c16f8 100644 --- a/src/main/java/fr/insee/rmes/config/ApplicationContext.java +++ b/src/main/java/fr/insee/rmes/config/ApplicationContext.java @@ -78,12 +78,13 @@ public RestTemplate restTemplate(RestTemplateBuilder builder) { @Bean public OpenAPI customOpenAPI() { + String serverUrl = "http://"; if (isProductionProfileActive()) { - return new OpenAPI().servers(List.of( - new Server().url("https://" + serverHost ).description("HTTPS Server"))); - } else { - return new OpenAPI(); + serverUrl = "https://"; } + + return new OpenAPI().servers(List.of( + new Server().url(serverUrl + serverHost).description("Server"))); } private boolean isProductionProfileActive() {