inverted the sense of aliases on contextHandler
git-svn-id: svn+ssh://dev.eclipse.org/svnroot/rt/org.eclipse.jetty/jetty/trunk@226 7e9141cc-0065-0410-87d8-b60c137991c4
This commit is contained in:
parent
9ef16a8d7a
commit
573cccb8df
|
@ -119,7 +119,7 @@ public class ContextHandler extends ScopedHandler implements Attributes, Server.
|
|||
private boolean _allowNullPathInfo;
|
||||
private int _maxFormContentSize=Integer.getInteger("org.eclipse.jetty.server.Request.maxFormContentSize",200000).intValue();
|
||||
private boolean _compactPath=false;
|
||||
private boolean _aliases=true;
|
||||
private boolean _aliases=false;
|
||||
|
||||
private Object _contextListeners;
|
||||
private Object _contextAttributeListeners;
|
||||
|
@ -1154,7 +1154,7 @@ public class ContextHandler extends ScopedHandler implements Attributes, Server.
|
|||
}
|
||||
/* ------------------------------------------------------------ */
|
||||
/**
|
||||
* @return True if alias checking is performed on resources.
|
||||
* @return True if aliases are allowed
|
||||
*/
|
||||
public boolean isAliases()
|
||||
{
|
||||
|
@ -1163,7 +1163,7 @@ public class ContextHandler extends ScopedHandler implements Attributes, Server.
|
|||
|
||||
/* ------------------------------------------------------------ */
|
||||
/**
|
||||
* @param aliases alias checking performed on resources.
|
||||
* @param aliases aliases are allowed
|
||||
*/
|
||||
public void setAliases(boolean aliases)
|
||||
{
|
||||
|
@ -1325,7 +1325,7 @@ public class ContextHandler extends ScopedHandler implements Attributes, Server.
|
|||
path=URIUtil.canonicalPath(path);
|
||||
Resource resource=_baseResource.addPath(path);
|
||||
|
||||
if (_aliases && resource.getAlias()!=null)
|
||||
if (!_aliases && resource.getAlias()!=null)
|
||||
{
|
||||
if (resource.exists())
|
||||
Log.warn("Aliased resource: "+resource+"~="+resource.getAlias());
|
||||
|
|
|
@ -157,6 +157,7 @@ public class DefaultServlet extends HttpServlet implements ResourceFactory
|
|||
|
||||
if (getInitParameter("aliases")!=null)
|
||||
_contextHandler.setAliases(getInitBoolean("aliases",false));
|
||||
|
||||
boolean aliases=_contextHandler.isAliases();
|
||||
if (!aliases && !FileResource.getCheckAliases())
|
||||
throw new IllegalStateException("Alias checking disabled");
|
||||
|
|
Loading…
Reference in New Issue