Handler
, HandlerContainer
, Container
, Destroyable
, Dumpable
, LifeCycle
public class HostCheckHandler extends GzipHandler
AbstractLifeCycle.AbstractLifeCycleListener
Container.InheritedListener, Container.Listener
LifeCycle.Listener
FAILED, RUNNING, STARTED, STARTING, STOPPED, STOPPING
_bufferSize, _minGzipSize, _vary
_handler
Constructor | Description |
---|---|
HostCheckHandler(I2PAppContext ctx) |
MUST call setListenHosts() afterwards.
|
Modifier and Type | Method | Description |
---|---|---|
void |
handle(String pathInContext,
Request baseRequest,
HttpServletRequest httpRequest,
HttpServletResponse httpResponse) |
Block by Host header,
redirect HTTP to HTTPS,
pass everything else to the delegate.
|
void |
setListenHosts(Set<String> hosts) |
Set the legal hosts.
|
doStop, dumpThis, getServer
expandHandler, findContainerOf, getChildHandlerByClass, getChildHandlers, getChildHandlersByClass
addLifeCycleListener, getState, getState, getStopTimeout, isFailed, isRunning, isStarted, isStarting, isStopped, isStopping, removeLifeCycleListener, start, stop
addBean, addBean, addBean, addEventListener, addManaged, contains, dump, dump, dump, dump, dump, dumpBeans, dumpObject, dumpStdErr, getBean, getBeans, getBeans, isManaged, manage, removeBean, removeBeans, removeEventListener, setBeans, setStopTimeout, start, stop, unmanage, updateBean, updateBeans
addExcludedAgentPatterns, addExcludedMethods, addExcludedMimeTypes, addExcludedPaths, addIncludedAgentPatterns, addIncludedMethods, addIncludedMimeTypes, addIncludedPaths, doStart, getBufferSize, getExcluded, getExcludedAgentPatterns, getExcludedMethods, getExcludedMimeTypes, getExcludedPaths, getIncludedAgentPatterns, getIncludedMethods, getIncludedMimeTypes, getIncludedPaths, getMimeTypes, getMinGzipSize, getVary, newGzipResponseWrapper, newWriter, setBufferSize, setExcluded, setExcluded, setExcludeMimeTypes, setMimeTypes, setMimeTypes, setMinGzipSize, setVary
destroy, expandChildren, getHandler, getHandlers, setHandler, setServer
addLifeCycleListener, isFailed, isRunning, isStarted, isStarting, isStopped, isStopping, removeLifeCycleListener, start, stop
public HostCheckHandler(I2PAppContext ctx)
public void setListenHosts(Set<String> hosts)
hosts
- contains hostnames or IPs. But we allow all IPs anyway.public void handle(String pathInContext, Request baseRequest, HttpServletRequest httpRequest, HttpServletResponse httpResponse) throws IOException, ServletException
handle
in interface Handler
handle
in class GzipHandler
IOException
ServletException