@Override
    // wrapServletResponse() only gets called in certain configurations, we need to wrap them all
    protected ServletResponse prepareServletResponse(ServletRequest request, ServletResponse response, FilterChain chain) {
        if (isShiroEEDisabled(request.getServletContext()) || !(request instanceof HttpServletRequest)) {
            return super.prepareServletResponse(request, response, chain);
        } else {
            return new WrappedResponse(WebUtils.toHttp(response), request);
        }
    }
Stops JEE server from interpreting Shiro principal as direct EJB principal,
this has sideffects of trying to log in to remote EJBs with the credentials from Shiro,
which isn't what this meant to do, as it's meant to just transfer Shiro credentials
to remote EJB call site.

Thus, force null EJB principal for the web session,
as the real principal comes from the EjbSecurityFilter's doAs() call

Also handles X-Forwarded-Proto support
support/jakarta-ee/src/main/java/org/apache/shiro/ee/filters/ShiroFilter.java