@Override
    public HttpServletRequest readRequest(AwsProxyRequest request, SecurityContext securityContext, Context lambdaContext, ContainerConfig config)
            throws InvalidRequestEventException {
        // Expect the HTTP method and context to be populated. If they are not, we are handling an
        // unsupported event type.
        if (request.getHttpMethod() == null || request.getHttpMethod().equals("") || request.getRequestContext() == null) {
            throw new InvalidRequestEventException(INVALID_REQUEST_ERROR);
        }

        request.setPath(stripBasePath(request.getPath(), config));
        if (request.getMultiValueHeaders() != null && request.getMultiValueHeaders().getFirst(HttpHeaders.CONTENT_TYPE) != null) {
            String contentType = request.getMultiValueHeaders().getFirst(HttpHeaders.CONTENT_TYPE);
            // put single as we always expect to have one and only one content type in a request.
            request.getMultiValueHeaders().putSingle(HttpHeaders.CONTENT_TYPE, getContentTypeWithCharset(contentType, config));
        }
        AwsProxyHttpServletRequest servletRequest = new AwsProxyHttpServletRequest(request, lambdaContext, securityContext, config);
        servletRequest.setServletContext(servletContext);
        servletRequest.setAttribute(API_GATEWAY_CONTEXT_PROPERTY, request.getRequestContext());
        servletRequest.setAttribute(API_GATEWAY_STAGE_VARS_PROPERTY, request.getStageVariables());
        servletRequest.setAttribute(API_GATEWAY_EVENT_PROPERTY, request);
        servletRequest.setAttribute(ALB_CONTEXT_PROPERTY, request.getRequestContext().getElb());
        servletRequest.setAttribute(LAMBDA_CONTEXT_PROPERTY, lambdaContext);
        servletRequest.setAttribute(JAX_SECURITY_CONTEXT_PROPERTY, securityContext);

        return servletRequest;
    }
@Test
    void readRequest_emptyHeaders_expectSuccess() {
        AwsProxyRequest req = new AwsProxyRequestBuilder("/path", "GET").build();
        try {
            HttpServletRequest servletReq = reader.readRequest(req, null, null, ContainerConfig.defaultConfig());
            String headerValue = servletReq.getHeader(HttpHeaders.CONTENT_TYPE);
            assertNull(headerValue);
        } catch (InvalidRequestEventException e) {
            e.printStackTrace();
            fail("Failed to read request with null headers");
        }
    }