class LocalhostRequestProcessor extends ProcessorBase {

    @Override
    public void process(final WilmaHttpEntity entity) throws ApplicationException {
        WilmaHttpRequest request = (WilmaHttpRequest) entity;
        /**
         * If this method was called then localhost blocking is turned on,
         * so we only need to check if the request targets localhost in order to determine if it needs to be rerouted.
         */
        boolean requestNeedsRerouting = localhostRequestChecker.checkIfRequestTargetsLocalhost(request);
        if (requestNeedsRerouting) {
            localhostRequestRouter.reroute(request);
            request.setRerouted(true);
        }
    }

}