<BUG>boolean localHost = req.isFromLocalHost();</BUG><CONTEXT>res.setContentType("html");String ra = req.getRemoteAddress();User user = req.getUser();String serviceCommand = req.getHeader("servicemanager");boolean serviceManager = (serviceCommand != null);<extra_id_0>if ((serviceManager && localHost) ||((user != null) && (req.userHasRole("shutdown") || localHost)) ) {String username = serviceManager ? "ServiceManager" : user.getUsername();</CONTEXT>
boolean localHost = req.isFromLocalHost() || ra.equals("127.0.0.1");