diff --git a/src/main/java/org/cbioportal/web/IndexPageController.java b/src/main/java/org/cbioportal/web/IndexPageController.java index 322e399d5a4..2bd3b95b66f 100644 --- a/src/main/java/org/cbioportal/web/IndexPageController.java +++ b/src/main/java/org/cbioportal/web/IndexPageController.java @@ -23,6 +23,7 @@ import org.springframework.web.bind.annotation.RequestMapping; import java.io.IOException; +import java.util.HashMap; import java.util.Map; import static org.cbioportal.service.FrontendPropertiesServiceImpl.FrontendProperty; @@ -48,9 +49,20 @@ public class IndexPageController { private final ObjectMapper mapper = new ObjectMapper(); - private Map getFrontendProperties(HttpServletRequest request, Authentication authentication) { + private Map getFrontendProperties(HttpServletRequest request, Authentication authentication) { String baseUrl = requestUtils.getBaseUrl(request); - Map properties = frontendPropertiesService.getFrontendProperties(); + Map properties = new HashMap<>(); + + Map originalProperties = frontendPropertiesService.getFrontendProperties(); + + for (Map.Entry entry : originalProperties.entrySet()) { + String value = entry.getValue(); + if (value!=null && (value.equalsIgnoreCase("true") || value.equalsIgnoreCase("false"))) { + properties.put(entry.getKey(), Boolean.valueOf(value)); + } else { + properties.put(entry.getKey(), value); + } + } properties.put("base_url", baseUrl); properties.put("user_email_address", authentication != null ? authentication.getName(): "anonymousUser"); // TODO: Support skin.user_display_name