public static String getBaseUrl() {
        try {
            var requestAttrs = (ServletRequestAttributes) RequestContextHolder.currentRequestAttributes();
            return getBaseUrl(requestAttrs.getRequest());
        } catch (IllegalStateException e) {
            // method is called outside of web request context
            return "";
        }
    }
@Test
    public void testWithXForwardedHostCommaSeparated() throws Exception {
        // basic request
        doReturn("http").when(request).getScheme();
        doReturn("localhost").when(request).getServerName();
        doReturn(8080).when(request).getServerPort();
        doReturn("/").when(request).getContextPath();

        // XForwarded content
        doReturn("https").when(request).getHeader("X-Forwarded-Proto");
        var items = new ArrayList<String>();
        items.add("open-vsx.org, foo.com, bar.com");
        doReturn(Collections.enumeration(items)).when(request).getHeaders("X-Forwarded-Host");
        doReturn("/openvsx").when(request).getHeader("X-Forwarded-Prefix");
        assertThat(UrlUtil.getBaseUrl(request)).isEqualTo("https://open-vsx.org/openvsx/");
    }