static void setupXForwardedHeaders(OpenAPI openApi, Map<String, Object> headers) {
        String basePath = getBasePathFromOasDocument(openApi);
        String host = (String) headers.get(HEADER_HOST);
        String forwardedPrefix = (String) headers.get(HEADER_X_FORWARDED_PREFIX);

        if (ObjectHelper.isNotEmpty(forwardedPrefix)) {
            basePath = URISupport.joinPaths(forwardedPrefix, basePath);
        }
        String forwardedHost = (String) headers.get(HEADER_X_FORWARDED_HOST);
        if (ObjectHelper.isNotEmpty(forwardedHost)) {
            host = forwardedHost;
        }
        String proto = (String) headers.get(HEADER_X_FORWARDED_PROTO);
        if (openApi.getServers() != null) {
            openApi.getServers().clear();
        }
        if (ObjectHelper.isNotEmpty(proto)) {
            String[] schemes = proto.split(",");
            for (String schema : schemes) {
                String trimmedScheme = schema.trim();
                String serverUrl = String.format("%s://%s%s", trimmedScheme.toLowerCase(), host, basePath);
                openApi.addServersItem(new Server().url(serverUrl));
            }
        } else {
            openApi.addServersItem(new Server().url(basePath));
        }
    }
@Test
    public void shouldAdaptFromXForwardHeadersV3() {
        OpenAPI doc = new OpenAPI();
        doc.addServersItem(new Server().url("http://myhost/base"));
        final OpenAPI openApi = spy(doc);

        final Map<String, Object> headers = new HashMap<>();
        headers.put(RestOpenApiSupport.HEADER_X_FORWARDED_PREFIX, "/prefix");
        headers.put(RestOpenApiSupport.HEADER_X_FORWARDED_HOST, "host");
        headers.put(RestOpenApiSupport.HEADER_X_FORWARDED_PROTO, "http, HTTPS ");
        RestOpenApiSupport.setupXForwardedHeaders(openApi, headers);

        assertEquals("http://host/prefix/base", openApi.getServers().get(0).getUrl());
        assertEquals("https://host/prefix/base", openApi.getServers().get(1).getUrl());

    }