@Override
    public String getServerName() {
        String region = System.getenv("AWS_REGION");
        if (region == null) {
            // this is not a critical failure, we just put a static region in the URI
            region = "us-east-1";
        }

        if (request.getMultiValueHeaders() != null && request.getMultiValueHeaders().containsKey(HOST_HEADER_NAME)) {
            String hostHeader = request.getMultiValueHeaders().getFirst(HOST_HEADER_NAME);
            if (SecurityUtils.isValidHost(hostHeader, request.getRequestContext().getApiId(), request.getRequestContext().getElb(), region)) {
                return hostHeader;
            }
        }

        return new StringBuilder().append(request.getRequestContext().getApiId())
                                                .append(".execute-api.")
                                                .append(region)
                                                .append(".amazonaws.com").toString();
    }
@Test
    void serverName_albHostHeader_returnsHostHeader() {
        initAwsProxyHttpServletRequestTest("ALB");
        AwsProxyRequestBuilder proxyReq = new AwsProxyRequestBuilder("/test", "GET")
                .header(HttpHeaders.HOST, "testapi.us-east-1.elb.amazonaws.com");
        HttpServletRequest servletReq = getRequest(proxyReq, null, null);
        String serverName = servletReq.getServerName();
        assertEquals("testapi.us-east-1.elb.amazonaws.com", serverName);
    }