Package net.i2p.router.web
Class HostCheckHandler
java.lang.Object
org.eclipse.jetty.util.component.AbstractLifeCycle
org.eclipse.jetty.util.component.ContainerLifeCycle
org.eclipse.jetty.server.Handler.Abstract
org.eclipse.jetty.server.Handler.AbstractContainer
org.eclipse.jetty.server.Handler.Wrapper
org.eclipse.jetty.server.handler.gzip.GzipHandler
net.i2p.router.web.HostCheckHandler
- All Implemented Interfaces:
Handler,Handler.Container,org.eclipse.jetty.server.handler.gzip.GzipFactory,Handler.Singleton,Request.Handler,Container,Destroyable,Dumpable,Dumpable.DumpableContainer,LifeCycle,Invocable
public class HostCheckHandler
extends org.eclipse.jetty.server.handler.gzip.GzipHandler
Block certain Host headers to prevent DNS rebinding attacks.
This Handler wraps the ContextHandlerCollection, which handles
all the webapps (not just routerconsole).
Therefore, this protects all the webapps.
- Since:
- 0.9.32
-
Nested Class Summary
Nested classes/interfaces inherited from class org.eclipse.jetty.server.Handler.Abstract
Handler.Abstract.NonBlockingNested classes/interfaces inherited from class org.eclipse.jetty.util.component.AbstractLifeCycle
AbstractLifeCycle.AbstractLifeCycleListener, AbstractLifeCycle.StopExceptionNested classes/interfaces inherited from interface org.eclipse.jetty.util.component.Container
Container.InheritedListener, Container.ListenerNested classes/interfaces inherited from interface org.eclipse.jetty.util.component.Dumpable
Dumpable.DumpableContainerNested classes/interfaces inherited from interface org.eclipse.jetty.server.Handler
Handler.Abstract, Handler.AbstractContainer, Handler.Collection, Handler.Container, Handler.Sequence, Handler.Singleton, Handler.WrapperNested classes/interfaces inherited from interface org.eclipse.jetty.util.thread.Invocable
Invocable.Callable, Invocable.InvocationType, Invocable.ReadyTask, Invocable.TaskNested classes/interfaces inherited from interface org.eclipse.jetty.util.component.LifeCycle
LifeCycle.ListenerNested classes/interfaces inherited from interface org.eclipse.jetty.server.Request.Handler
Request.Handler.AbortException -
Field Summary
Fields inherited from class org.eclipse.jetty.server.handler.gzip.GzipHandler
BREAK_EVEN_GZIP_SIZE, DEFAULT_MIN_GZIP_SIZE, DEFLATE, GZIP, GZIP_HANDLER_ETAGSFields inherited from class org.eclipse.jetty.util.component.AbstractLifeCycle
FAILED, STARTED, STARTING, STOPPED, STOPPINGFields inherited from interface org.eclipse.jetty.util.thread.Invocable
__nonBlocking, NOOP -
Constructor Summary
Constructors -
Method Summary
Methods inherited from class org.eclipse.jetty.server.handler.gzip.GzipHandler
addExcludedInflationPaths, addExcludedMethods, addExcludedMimeTypes, addExcludedPaths, addIncludedInflationPaths, addIncludedMethods, addIncludedMimeTypes, addIncludedPaths, doStart, doStop, getDeflaterEntry, getDeflaterPool, getExcludedInflationPaths, getExcludedMethodList, getExcludedMethods, getExcludedMimeTypes, getExcludedPaths, getIncludedInflationPaths, getIncludedMethodList, getIncludedMethods, getIncludedMimeTypes, getIncludedPaths, getInflateBufferSize, getInflaterPool, getMinGzipSize, getVary, isMimeTypeDeflatable, isMimeTypeDeflatable, isPathDeflatable, isPathInflatable, isSyncFlush, setDeflaterPool, setExcludedInflatePaths, setExcludedMethodList, setExcludedMethods, setExcludedMimeTypes, setExcludedMimeTypesList, setExcludedPaths, setIncludedInflatePaths, setIncludedMethodList, setIncludedMethods, setIncludedMimeTypes, setIncludedMimeTypesList, setIncludedPaths, setInflateBufferSize, setInflaterPool, setMinGzipSize, setSyncFlush, setVary, toStringMethods inherited from class org.eclipse.jetty.server.Handler.Wrapper
getHandler, getInvocationType, setHandlerMethods inherited from class org.eclipse.jetty.server.Handler.AbstractContainer
findContainerOf, getDescendant, getDescendants, isDynamic, setDynamic, setServerMethods inherited from class org.eclipse.jetty.server.Handler.Abstract
destroy, getServerMethods inherited from class org.eclipse.jetty.util.component.ContainerLifeCycle
addBean, addBean, addEventListener, addManaged, contains, dump, dump, dump, dumpObjects, dumpStdErr, getBean, getBeans, getBeans, getContainedBeans, getContainedBeans, installBean, installBean, isAuto, isManaged, isUnmanaged, manage, removeBean, removeBeans, removeEventListener, setBeans, start, stop, unmanage, updateBean, updateBean, updateBeans, updateBeansMethods inherited from class org.eclipse.jetty.util.component.AbstractLifeCycle
getEventListeners, getState, getState, isFailed, isRunning, isStarted, isStarting, isStopped, isStopping, setEventListeners, start, stopMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface org.eclipse.jetty.util.component.Container
getCachedBeans, getEventListenersMethods inherited from interface org.eclipse.jetty.util.component.Destroyable
destroyMethods inherited from interface org.eclipse.jetty.util.component.Dumpable.DumpableContainer
isDumpableMethods inherited from interface org.eclipse.jetty.server.Handler.Container
getContainer, getDescendant, getDescendants, getDescendantsMethods inherited from interface org.eclipse.jetty.server.Handler.Singleton
getHandlers, getTail, insertHandler, setHandlerMethods inherited from interface org.eclipse.jetty.util.component.LifeCycle
addEventListener, isFailed, isRunning, isStarted, isStarting, isStopped, isStopping, removeEventListener, start, stop
-
Constructor Details
-
HostCheckHandler
MUST call setListenHosts() afterwards.
-
-
Method Details
-
setListenHosts
Set the legal hosts. Not synched. Call this BEFORE starting. If empty, all are allowed.- Parameters:
hosts- contains hostnames or IPs. But we allow all IPs anyway.
-
handle
Block by Host header, redirect HTTP to HTTPS, pass everything else to the delegate.- Specified by:
handlein interfaceRequest.Handler- Overrides:
handlein classorg.eclipse.jetty.server.handler.gzip.GzipHandler- Throws:
Exception
-