Class HostCheckHandler

All Implemented Interfaces:
Handler, Request.Handler, Container, Destroyable, Dumpable, Dumpable.DumpableContainer, LifeCycle, Invocable

public class HostCheckHandler extends Handler.Abstract
Block certain Host headers to prevent DNS rebinding attacks. Unlike in the console, this is an AbstractHandler, not a HandlerWrapper.
Since:
0.9.34 adapted from router console
  • Constructor Details

    • HostCheckHandler

      public HostCheckHandler()
    • HostCheckHandler

      public HostCheckHandler(I2PAppContext ctx)
  • Method Details

    • setListenHosts

      public void setListenHosts(Set<String> hosts)
      Unused, we can't get here from RunStandalone
      Parameters:
      hosts - contains hostnames or IPs. But we allow all IPs anyway.
    • handle

      public boolean handle(Request request, Response response, Callback callback) throws Exception
      Block by Host header, redirect HTTP to HTTPS, pass everything else to the delegate.
      Throws:
      Exception