Remove custom header code due to complexity & security concerns.
@@ -69,18 +69,14 @@ public class APIRequest extends HttpServletRequestWrapper {
super(request);
// Try a few methods to get client info.
- if (request.getHeader("X-Guacamole-Client-Hostname") != null && !request.getHeader("X-Guacamole-Client-Hostname").isEmpty())
- this.remoteHost = request.getHeader("X-Guacamole-Client-Hostname");
- else if (request.getHeader("X-Forwarded-For") != null && !request.getHeader("X-Forwarded-For").isEmpty())
+ if (request.getHeader("X-Forwarded-For") != null && !request.getHeader("X-Forwarded-For").isEmpty())
this.remoteHost = null;
else if (request.getRemoteHost() != null && !request.getRemoteHost().isEmpty())
this.remoteHost = request.getRemoteHost();
else
this.remoteHost = null;
- if (request.getHeader("X-Guacamole-Client-IP") != null && !request.getHeader("X-Guacamole-Client-IP").isEmpty())
- this.remoteAddr = request.getHeader("X-Guacamole-Client-IP");
- else if(request.getHeader("X-Forwarded-For") != null && !request.getHeader("X-Forwarded-For").isEmpty())
+ if(request.getHeader("X-Forwarded-For") != null && !request.getHeader("X-Forwarded-For").isEmpty())
this.remoteAddr = request.getHeader("X-Forwarded-For");
else if(request.getRemoteHost() != null && !request.getRemoteAddr().isEmpty())
this.remoteAddr = request.getRemoteAddr();
