java/src/main/java/com/genexus/filters/SecuredRemoteAddressFilter.java
/**
     * If incoming remote address matches one of the declared IP pattern, wraps
     * the incoming {@link HttpServletRequest} to override
     * {@link HttpServletRequest#isSecure()} to set it to <code>true</code>.
     */
If incoming remote address matches one of the declared IP pattern, wraps
the incoming  HttpServletRequest to override
HttpServletRequest#isSecure() to set it to true.
If incoming remote address matches one of the declared IP pattern wraps the incoming HttpServletRequest to override HttpServletRequest#isSecure () to set it to true .
public void doFilter(IServletRequest request, IServletResponse response, IFilterChain chain) throws Exception {
       	IServletRequest xRequest;
        if (request.isHttpServletRequest() && response.isHttpServletResponse()) {
            if (!request.isSecure() && matchesOne(request.getRemoteAddr(), securedRemoteAddresses)) {
				IHttpServletRequestWrapper reqw = new HttpServletRequestWrapper(request.getHttpServletRequest()) {
                    @Override
                    public boolean isSecure() {
                        return true;
                    }
                };
				xRequest = reqw.getServletRequest();
            } else {
                xRequest = request;
            }
        } else {
            xRequest = request;
        }
        chain.doFilter(xRequest, response);
    }
public void doFilter ( IServletRequest request , IServletResponse response , IFilterChain chain ) throws Exception { IServletRequest xRequest ; if ( request . isHttpServletRequest ( ) && response . isHttpServletResponse ( ) ) { if ( ! request . isSecure ( ) && matchesOne ( request . getRemoteAddr ( ) , securedRemoteAddresses ) ) { IHttpServletRequestWrapper reqw = new HttpServletRequestWrapper ( request . getHttpServletRequest ( ) ) { @ Override public boolean isSecure ( ) { return true ; } } ; xRequest = reqw . getServletRequest ( ) ; } else { xRequest = request ; } } else { xRequest = request ; } chain . doFilter ( xRequest , response ) ; }
If incoming remote address matches one of the declared IP pattern, wraps
 the incoming {@link HttpServletRequest} to override
 {@link HttpServletRequest#isSecure()} to set it to <code>true</code>.
If incoming remote address matches one of the declared IP pattern wraps the incoming { @link HttpServletRequest } to override { @link HttpServletRequest#isSecure () } to set it to <code > true< / code > .