Merge branch 'master' of ssh://git.eclipse.org/gitroot/jetty/org.eclipse.jetty.project

This commit is contained in:
Simone Bordet 2012-01-17 23:06:46 +01:00
commit b57bf3b600
34 changed files with 401 additions and 274 deletions

View File

@ -1,5 +1,20 @@
jetty-7.6.0-SNAPSHOT jetty-7.6.0-SNAPSHOT
jetty-7.6.0.RC4 - 13 January 2012
+ 365048 jetty Http client does not send proxy authentication when requesting
a Https-resource through a web-proxy.
+ 366774 removed XSS vulnerbility
+ 367099 Upgrade jetty-websocket for RFC 6455 - Addendum.
+ 367716 simplified maxIdleTime logic
+ 368035 WebSocketClientFactory does not invoke super.doStop().
+ 368060 do not encode sendRedirect URLs
+ 368114 Protect against non-Strings in System properties for Log
+ 368189 WebSocketClientFactory should not manage external thread pool.
+ 368215 Remove debug from jaspi
+ 368240 Improve AggregateLifeCycle handling of shared lifecycles
+ 368291 Change warning to info for NoSuchFieldException on
BeanELResolver.properties
jetty-7.6.0.RC3 - 05 January 2012 jetty-7.6.0.RC3 - 05 January 2012
+ 367433 added tests to investigate + 367433 added tests to investigate
+ 367435 improved D00 test harness + 367435 improved D00 test harness
@ -8,7 +23,7 @@ jetty-7.6.0.RC3 - 05 January 2012
stopped. stopped.
+ 367591 corrected configuration.xml version to 7.6 + 367591 corrected configuration.xml version to 7.6
+ 367635 Added support for start.d directory + 367635 Added support for start.d directory
+ 637638 limit number of form parameters to avoid DOS + 367638 limit number of form parameters to avoid DOS
+ JETTY-1467 close half closed when idle + JETTY-1467 close half closed when idle
jetty-7.6.0.RC2 - 22 December 2011 jetty-7.6.0.RC2 - 22 December 2011

View File

@ -163,10 +163,6 @@
<groupId>javax.mail</groupId> <groupId>javax.mail</groupId>
<artifactId>mail</artifactId> <artifactId>mail</artifactId>
</exclusion> </exclusion>
<exclusion>
<groupId>javax.activation</groupId>
<artifactId>activation</artifactId>
</exclusion>
</exclusions> </exclusions>
</dependency> </dependency>
<dependency> <dependency>
@ -237,11 +233,6 @@
<artifactId>mail</artifactId> <artifactId>mail</artifactId>
<scope>compile</scope> <scope>compile</scope>
</dependency> </dependency>
<dependency>
<groupId>javax.activation</groupId>
<artifactId>activation</artifactId>
<scope>compile</scope>
</dependency>
<dependency> <dependency>
<groupId>org.apache.geronimo.specs</groupId> <groupId>org.apache.geronimo.specs</groupId>
<artifactId>geronimo-jaspic_1.0_spec</artifactId> <artifactId>geronimo-jaspic_1.0_spec</artifactId>

View File

@ -147,10 +147,6 @@
<groupId>javax.mail</groupId> <groupId>javax.mail</groupId>
<artifactId>mail</artifactId> <artifactId>mail</artifactId>
</exclusion> </exclusion>
<exclusion>
<groupId>javax.activation</groupId>
<artifactId>activation</artifactId>
</exclusion>
</exclusions> </exclusions>
</dependency> </dependency>
<dependency> <dependency>
@ -221,11 +217,6 @@
<artifactId>mail</artifactId> <artifactId>mail</artifactId>
<scope>compile</scope> <scope>compile</scope>
</dependency> </dependency>
<dependency>
<groupId>javax.activation</groupId>
<artifactId>activation</artifactId>
<scope>compile</scope>
</dependency>
<dependency> <dependency>
<groupId>org.apache.geronimo.specs</groupId> <groupId>org.apache.geronimo.specs</groupId>
<artifactId>geronimo-jaspic_1.0_spec</artifactId> <artifactId>geronimo-jaspic_1.0_spec</artifactId>

View File

@ -96,10 +96,6 @@
<groupId>javax.mail</groupId> <groupId>javax.mail</groupId>
<artifactId>mail</artifactId> <artifactId>mail</artifactId>
</exclusion> </exclusion>
<exclusion>
<groupId>javax.activation</groupId>
<artifactId>activation</artifactId>
</exclusion>
</exclusions> </exclusions>
</dependency> </dependency>
<dependency> <dependency>
@ -117,10 +113,5 @@
<artifactId>mail</artifactId> <artifactId>mail</artifactId>
<scope>compile</scope> <scope>compile</scope>
</dependency> </dependency>
<dependency>
<groupId>javax.activation</groupId>
<artifactId>activation</artifactId>
<scope>compile</scope>
</dependency>
</dependencies> </dependencies>
</project> </project>

View File

@ -1,5 +1,5 @@
<?xml version="1.0" encoding="ISO-8859-1"?> <?xml version="1.0" encoding="ISO-8859-1"?>
<!DOCTYPE Configure PUBLIC "-//Mort Bay Consulting//DTD Configure//EN" "http://jetty.mortbay.org/configure.dtd"> <!DOCTYPE Configure PUBLIC "-//Mort Bay Consulting//DTD Configure//EN" "http://www.eclipse.org/jetty/configure.dtd">
<Configure class="org.eclipse.jetty.webapp.WebAppContext"> <Configure class="org.eclipse.jetty.webapp.WebAppContext">
<Set name="contextPath">/foo</Set> <Set name="contextPath">/foo</Set>
<Set name="war"> <Set name="war">

View File

@ -12,7 +12,6 @@
<jetty-orbit-url>http://download.eclipse.org/jetty/orbit</jetty-orbit-url> <jetty-orbit-url>http://download.eclipse.org/jetty/orbit</jetty-orbit-url>
<assembly-directory>target/distribution</assembly-directory> <assembly-directory>target/distribution</assembly-directory>
<eclipse-ecj-version>3.6</eclipse-ecj-version> <eclipse-ecj-version>3.6</eclipse-ecj-version>
<orbit-javax-activation-version>${javax-activation-version}.0.v201005080500</orbit-javax-activation-version>
<orbit-javax-annotation-version>1.0.0.v20100513-0750</orbit-javax-annotation-version> <orbit-javax-annotation-version>1.0.0.v20100513-0750</orbit-javax-annotation-version>
<orbit-javax-el-version>2.1.0.v201004190952</orbit-javax-el-version> <orbit-javax-el-version>2.1.0.v201004190952</orbit-javax-el-version>
<orbit-javax-mail-glassfish-version>${javax-mail-version}.v201005082020</orbit-javax-mail-glassfish-version> <orbit-javax-mail-glassfish-version>${javax-mail-version}.v201005082020</orbit-javax-mail-glassfish-version>
@ -69,7 +68,6 @@
<mkdir dir="${orbit-cache}" /> <mkdir dir="${orbit-cache}" />
<get dest="${orbit-cache}" verbose="true" skipexisting="true"> <get dest="${orbit-cache}" verbose="true" skipexisting="true">
<url url="${jetty-orbit-url}/javax.servlet_${orbit-javax-servlet-version}.jar" /> <url url="${jetty-orbit-url}/javax.servlet_${orbit-javax-servlet-version}.jar" />
<url url="${jetty-orbit-url}/javax.activation_${orbit-javax-activation-version}.jar" />
<url url="${jetty-orbit-url}/javax.annotation_${orbit-javax-annotation-version}.jar" /> <url url="${jetty-orbit-url}/javax.annotation_${orbit-javax-annotation-version}.jar" />
<url url="${jetty-orbit-url}/javax.mail.glassfish_${orbit-javax-mail-glassfish-version}.jar" /> <url url="${jetty-orbit-url}/javax.mail.glassfish_${orbit-javax-mail-glassfish-version}.jar" />
<url url="${jetty-orbit-url}/javax.el_${orbit-javax-el-version}.jar" /> <url url="${jetty-orbit-url}/javax.el_${orbit-javax-el-version}.jar" />

View File

@ -63,8 +63,8 @@ public class HttpParser implements Parser
private Buffer _body; // Buffer for large content private Buffer _body; // Buffer for large content
private Buffer _buffer; // The current buffer in use (either _header or _content) private Buffer _buffer; // The current buffer in use (either _header or _content)
private CachedBuffer _cached; private CachedBuffer _cached;
private View.CaseInsensitive _tok0; // Saved token: header name, request method or response version private final View.CaseInsensitive _tok0; // Saved token: header name, request method or response version
private View.CaseInsensitive _tok1; // Saved token: header value, request URI or response code private final View.CaseInsensitive _tok1; // Saved token: header value, request URI or response code
private String _multiLineValue; private String _multiLineValue;
private int _responseStatus; // If >0 then we are parsing a response private int _responseStatus; // If >0 then we are parsing a response
private boolean _forceContentBuffer; private boolean _forceContentBuffer;
@ -93,13 +93,8 @@ public class HttpParser implements Parser
_buffer=buffer; _buffer=buffer;
_handler=handler; _handler=handler;
if (buffer != null) _tok0=new View.CaseInsensitive(_header);
{ _tok1=new View.CaseInsensitive(_header);
_tok0=new View.CaseInsensitive(buffer);
_tok1=new View.CaseInsensitive(buffer);
_tok0.setPutIndex(_tok0.getIndex());
_tok1.setPutIndex(_tok1.getIndex());
}
} }
/* ------------------------------------------------------------------------------- */ /* ------------------------------------------------------------------------------- */
@ -114,6 +109,8 @@ public class HttpParser implements Parser
_buffers=buffers; _buffers=buffers;
_endp=endp; _endp=endp;
_handler=handler; _handler=handler;
_tok0=new View.CaseInsensitive();
_tok1=new View.CaseInsensitive();
} }
/* ------------------------------------------------------------------------------- */ /* ------------------------------------------------------------------------------- */
@ -256,17 +253,7 @@ public class HttpParser implements Parser
return 0; return 0;
if (_buffer==null) if (_buffer==null)
{ _buffer=getHeaderBuffer();
if (_header == null)
{
_header=_buffers.getHeader();
}
_buffer=_header;
_tok0=new View.CaseInsensitive(_header);
_tok1=new View.CaseInsensitive(_header);
_tok0.setPutIndex(_tok0.getIndex());
_tok1.setPutIndex(_tok1.getIndex());
}
if (_state == STATE_CONTENT && _contentPosition == _contentLength) if (_state == STATE_CONTENT && _contentPosition == _contentLength)
@ -1013,11 +1000,7 @@ public class HttpParser implements Parser
{ {
// Do we have a buffer? // Do we have a buffer?
if (_buffer==null) if (_buffer==null)
{ _buffer=getHeaderBuffer();
_buffer=_header=getHeaderBuffer();
_tok0=new View.CaseInsensitive(_buffer);
_tok1=new View.CaseInsensitive(_buffer);
}
// Is there unconsumed content in body buffer // Is there unconsumed content in body buffer
if (_state>STATE_END && _buffer==_header && _header!=null && !_header.hasContent() && _body!=null && _body.hasContent()) if (_state>STATE_END && _buffer==_header && _header!=null && !_header.hasContent() && _body!=null && _body.hasContent())
@ -1086,9 +1069,7 @@ public class HttpParser implements Parser
// This is probably a pipelined header of the next request, so we need to // This is probably a pipelined header of the next request, so we need to
// copy it to the header buffer. // copy it to the header buffer.
if (_header==null) if (_header==null)
{ getHeaderBuffer();
_header=_buffers.getHeader();
}
else else
{ {
_header.setMarkIndex(-1); _header.setMarkIndex(-1);
@ -1165,6 +1146,8 @@ public class HttpParser implements Parser
if (_header == null) if (_header == null)
{ {
_header=_buffers.getHeader(); _header=_buffers.getHeader();
_tok0.update(_header);
_tok1.update(_header);
} }
return _header; return _header;
} }

View File

@ -373,7 +373,7 @@ public abstract class SelectorManager extends AbstractLifeCycle implements Dumpa
/* ------------------------------------------------------------ */ /* ------------------------------------------------------------ */
public void dump(Appendable out, String indent) throws IOException public void dump(Appendable out, String indent) throws IOException
{ {
out.append(String.valueOf(this)).append("\n"); AggregateLifeCycle.dumpObject(out,this);
AggregateLifeCycle.dump(out,indent,TypeUtil.asList(_selectSet)); AggregateLifeCycle.dump(out,indent,TypeUtil.asList(_selectSet));
} }
@ -985,9 +985,8 @@ public abstract class SelectorManager extends AbstractLifeCycle implements Dumpa
public String toString() public String toString()
{ {
Selector selector=_selector; Selector selector=_selector;
return String.format("%s %s keys=%d selected=%d", return String.format("%s keys=%d selected=%d",
super.toString(), super.toString(),
SelectorManager.this.getState(),
selector != null && selector.isOpen() ? selector.keys().size() : -1, selector != null && selector.isOpen() ? selector.keys().size() : -1,
selector != null && selector.isOpen() ? selector.selectedKeys().size() : -1); selector != null && selector.isOpen() ? selector.selectedKeys().size() : -1);
} }

View File

@ -274,40 +274,55 @@ public class SslConnection extends AbstractConnection implements AsyncConnection
boolean some_progress=false; boolean some_progress=false;
try try
{ {
// We need buffers to progress
allocateBuffers(); allocateBuffers();
// if we don't have a buffer to put received data into
if (toFill==null) if (toFill==null)
{ {
// use the unwrapbuffer to hold received data.
_unwrapBuf.compact(); _unwrapBuf.compact();
toFill=_unwrapBuf; toFill=_unwrapBuf;
} }
// Else if the fill buffer is too small for the SSL session
else if (toFill.capacity()<_session.getApplicationBufferSize()) else if (toFill.capacity()<_session.getApplicationBufferSize())
{ {
// fill to the temporary unwrapBuffer
boolean progress=process(null,toFlush); boolean progress=process(null,toFlush);
// if we received any data,
if (_unwrapBuf!=null && _unwrapBuf.hasContent()) if (_unwrapBuf!=null && _unwrapBuf.hasContent())
{ {
// transfer from temp buffer to fill buffer
_unwrapBuf.skip(toFill.put(_unwrapBuf)); _unwrapBuf.skip(toFill.put(_unwrapBuf));
return true; return true;
} }
else else
// return progress from recursive call
return progress; return progress;
} }
// Else if there is some temporary data
else if (_unwrapBuf!=null && _unwrapBuf.hasContent()) else if (_unwrapBuf!=null && _unwrapBuf.hasContent())
{ {
// transfer from temp buffer to fill buffer
_unwrapBuf.skip(toFill.put(_unwrapBuf)); _unwrapBuf.skip(toFill.put(_unwrapBuf));
return true; return true;
} }
// If we are here, we have a buffer ready into which we can put some read data.
// If we have no data to flush, flush the empty buffer
if (toFlush==null) if (toFlush==null)
toFlush=__ZERO_BUFFER; toFlush=__ZERO_BUFFER;
// While we are making progress processing SSL engine
boolean progress=true; boolean progress=true;
while (progress) while (progress)
{ {
progress=false; progress=false;
// Do any real IO
int filled=0,flushed=0; int filled=0,flushed=0;
try try
{ {
// Read any available data // Read any available data
@ -356,20 +371,6 @@ public class SslConnection extends AbstractConnection implements AsyncConnection
task.run(); task.run();
} }
// Detect SUN JVM Bug!!!
/* TODO
if(initialStatus==HandshakeStatus.NOT_HANDSHAKING &&
_engine.getHandshakeStatus()==HandshakeStatus.NEED_UNWRAP && sent==0 )
{
// This should be NEED_WRAP
// The fix simply detects the signature of the bug and then close the connection (fail-fast) so that ff3 will delegate to using SSL instead of TLS.
// This is a jvm bug on java1.6 where the SSLEngine expects more data from the initial handshake when the client(ff3-tls) already had given it.
// See http://jira.codehaus.org/browse/JETTY-567 for more details
LOG.warn("{} JETTY-567",_session);
_endp.close();
return false;
}
*/
} }
break; break;
@ -401,10 +402,12 @@ public class SslConnection extends AbstractConnection implements AsyncConnection
if (_endp.isOpen() && _engine.isOutboundDone() && !_outbound.hasContent()) if (_endp.isOpen() && _engine.isOutboundDone() && !_outbound.hasContent())
_endp.shutdownOutput(); _endp.shutdownOutput();
// remember if any progress has been made
some_progress|=progress; some_progress|=progress;
} }
if (toFill.hasContent()) // If we are reading into the temp buffer and it has some content, then we should be dispatched.
if (toFill==_unwrapBuf && _unwrapBuf.hasContent())
_aEndp.asyncDispatch(); _aEndp.asyncDispatch();
} }
finally finally

View File

@ -337,7 +337,7 @@ public class MBeanContainer extends AbstractLifeCycle implements Container.Liste
public void dump(Appendable out, String indent) throws IOException public void dump(Appendable out, String indent) throws IOException
{ {
out.append(toString()).append("\n"); AggregateLifeCycle.dumpObject(out,this);
AggregateLifeCycle.dump(out, indent, _beans.entrySet()); AggregateLifeCycle.dump(out, indent, _beans.entrySet());
} }

View File

@ -14,7 +14,6 @@
<jetty-orbit-url>http://download.eclipse.org/jetty/orbit/</jetty-orbit-url> <jetty-orbit-url>http://download.eclipse.org/jetty/orbit/</jetty-orbit-url>
<assembly-directory>target/distribution</assembly-directory> <assembly-directory>target/distribution</assembly-directory>
<eclipse-ecj-version>3.6</eclipse-ecj-version> <eclipse-ecj-version>3.6</eclipse-ecj-version>
<orbit-javax-activation-version>${javax-activation-version}.0.v201005080500</orbit-javax-activation-version>
<orbit-javax-annotation-version>1.0.0.v20100513-0750</orbit-javax-annotation-version> <orbit-javax-annotation-version>1.0.0.v20100513-0750</orbit-javax-annotation-version>
<orbit-javax-el-version>2.1.0.v201004190952</orbit-javax-el-version> <orbit-javax-el-version>2.1.0.v201004190952</orbit-javax-el-version>
<orbit-javax-mail-glassfish-version>${javax-mail-version}.v201005082020</orbit-javax-mail-glassfish-version> <orbit-javax-mail-glassfish-version>${javax-mail-version}.v201005082020</orbit-javax-mail-glassfish-version>
@ -198,7 +197,6 @@
<mkdir dir="${orbit-cache}" /> <mkdir dir="${orbit-cache}" />
<get dest="${orbit-cache}" verbose="true" skipexisting="true"> <get dest="${orbit-cache}" verbose="true" skipexisting="true">
<url url="${jetty-orbit-url}/javax.servlet_${orbit-javax-servlet-version}.jar" /> <url url="${jetty-orbit-url}/javax.servlet_${orbit-javax-servlet-version}.jar" />
<url url="${jetty-orbit-url}/javax.activation_${orbit-javax-activation-version}.jar" />
<url url="${jetty-orbit-url}/javax.mail.glassfish_${orbit-javax-mail-glassfish-version}.jar" /> <url url="${jetty-orbit-url}/javax.mail.glassfish_${orbit-javax-mail-glassfish-version}.jar" />
<url url="${jetty-orbit-url}/javax.el_${orbit-javax-el-version}.jar" /> <url url="${jetty-orbit-url}/javax.el_${orbit-javax-el-version}.jar" />
<url url="${jetty-orbit-url}/javax.servlet.jsp_${orbit-javax-servlet-jsp-version}.jar" /> <url url="${jetty-orbit-url}/javax.servlet.jsp_${orbit-javax-servlet-jsp-version}.jar" />

View File

@ -358,7 +358,7 @@ public class ConstraintSecurityHandler extends SecurityHandler implements Constr
{ {
if (connector.isIntegral(request)) if (connector.isIntegral(request))
return true; return true;
if (connector.getConfidentialPort() > 0) if (connector.getIntegralPort() > 0)
{ {
String url = connector.getIntegralScheme() + "://" + request.getServerName() + ":" + connector.getIntegralPort() + request.getRequestURI(); String url = connector.getIntegralScheme() + "://" + request.getServerName() + ":" + connector.getIntegralPort() + request.getRequestURI();
if (request.getQueryString() != null) if (request.getQueryString() != null)
@ -440,6 +440,13 @@ public class ConstraintSecurityHandler extends SecurityHandler implements Constr
public void dump(Appendable out,String indent) throws IOException public void dump(Appendable out,String indent) throws IOException
{ {
dumpThis(out); dumpThis(out);
dump(out,indent,TypeUtil.asList(getHandlers()),getBeans(),Collections.singleton(_roles),_constraintMap.entrySet()); dump(out,indent,
Collections.singleton(getLoginService()),
Collections.singleton(getIdentityService()),
Collections.singleton(getAuthenticator()),
Collections.singleton(_roles),
_constraintMap.entrySet(),
getBeans(),
TypeUtil.asList(getHandlers()));
} }
} }

View File

@ -244,16 +244,19 @@ public abstract class SecurityHandler extends HandlerWrapper implements Authenti
return _initParameters.put(key,value); return _initParameters.put(key,value);
} }
/* ------------------------------------------------------------ */ /* ------------------------------------------------------------ */
protected LoginService findLoginService() protected LoginService findLoginService()
{ {
List<LoginService> list = getServer().getBeans(LoginService.class); List<LoginService> list = getServer().getBeans(LoginService.class);
for (LoginService service : list) String realm=getRealmName();
if (service.getName()!=null && service.getName().equals(getRealmName())) if (realm!=null)
return service; {
if (list.size()>0) for (LoginService service : list)
if (service.getName()!=null && service.getName().equals(realm))
return service;
}
else if (list.size()==1)
return list.get(0); return list.get(0);
return null; return null;
} }
@ -414,7 +417,7 @@ public abstract class SecurityHandler extends HandlerWrapper implements Authenti
final Authenticator authenticator = _authenticator; final Authenticator authenticator = _authenticator;
if (authenticator!=null && checkSecurity(baseRequest)) if (checkSecurity(baseRequest))
{ {
Object constraintInfo = prepareConstraintInfo(pathInContext, baseRequest); Object constraintInfo = prepareConstraintInfo(pathInContext, baseRequest);
@ -433,13 +436,24 @@ public abstract class SecurityHandler extends HandlerWrapper implements Authenti
boolean isAuthMandatory = boolean isAuthMandatory =
isAuthMandatory(baseRequest, base_response, constraintInfo); isAuthMandatory(baseRequest, base_response, constraintInfo);
if (isAuthMandatory && authenticator==null)
{
LOG.warn("No authenticator for: "+constraintInfo);
if (!baseRequest.isHandled())
{
response.sendError(Response.SC_FORBIDDEN);
baseRequest.setHandled(true);
}
return;
}
// check authentication // check authentication
Object previousIdentity = null; Object previousIdentity = null;
try try
{ {
Authentication authentication = baseRequest.getAuthentication(); Authentication authentication = baseRequest.getAuthentication();
if (authentication==null || authentication==Authentication.NOT_CHECKED) if (authentication==null || authentication==Authentication.NOT_CHECKED)
authentication=authenticator.validateRequest(request, response, isAuthMandatory); authentication=authenticator==null?Authentication.UNAUTHENTICATED:authenticator.validateRequest(request, response, isAuthMandatory);
if (authentication instanceof Authentication.Wrapped) if (authentication instanceof Authentication.Wrapped)
{ {
@ -500,9 +514,11 @@ public abstract class SecurityHandler extends HandlerWrapper implements Authenti
else else
{ {
baseRequest.setAuthentication(authentication); baseRequest.setAuthentication(authentication);
previousIdentity = _identityService.associate(null); if (_identityService!=null)
previousIdentity = _identityService.associate(null);
handler.handle(pathInContext, baseRequest, request, response); handler.handle(pathInContext, baseRequest, request, response);
authenticator.secureResponse(request, response, isAuthMandatory, null); if (authenticator!=null)
authenticator.secureResponse(request, response, isAuthMandatory, null);
} }
} }
catch (ServerAuthException e) catch (ServerAuthException e)
@ -513,7 +529,8 @@ public abstract class SecurityHandler extends HandlerWrapper implements Authenti
} }
finally finally
{ {
_identityService.disassociate(previousIdentity); if (_identityService!=null)
_identityService.disassociate(previousIdentity);
} }
} }
else else

View File

@ -0,0 +1,178 @@
// ========================================================================
// Copyright (c) 2004-2009 Mort Bay Consulting Pty. Ltd.
// ------------------------------------------------------------------------
// All rights reserved. This program and the accompanying materials
// are made available under the terms of the Eclipse Public License v1.0
// and Apache License v2.0 which accompanies this distribution.
// The Eclipse Public License is available at
// http://www.eclipse.org/legal/epl-v10.html
// The Apache License v2.0 is available at
// http://www.opensource.org/licenses/apache2.0.php
// You may elect to redistribute this code under either of these licenses.
// ========================================================================
package org.eclipse.jetty.security;
import static org.junit.Assert.assertThat;
import static org.junit.matchers.JUnitMatchers.containsString;
import java.io.IOException;
import java.util.Arrays;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import org.eclipse.jetty.http.HttpSchemes;
import org.eclipse.jetty.io.EndPoint;
import org.eclipse.jetty.server.Connector;
import org.eclipse.jetty.server.LocalConnector;
import org.eclipse.jetty.server.Request;
import org.eclipse.jetty.server.Server;
import org.eclipse.jetty.server.handler.AbstractHandler;
import org.eclipse.jetty.server.handler.ContextHandler;
import org.eclipse.jetty.server.session.SessionHandler;
import org.eclipse.jetty.util.security.Constraint;
import org.junit.After;
import org.junit.Before;
import org.junit.Test;
/**
* @version $Revision: 1441 $ $Date: 2010-04-02 12:28:17 +0200 (Fri, 02 Apr 2010) $
*/
public class DataConstraintsTest
{
private Server _server;
private LocalConnector _connector;
private LocalConnector _connectorS;
private SessionHandler _session;
private ConstraintSecurityHandler _security;
@Before
public void startServer()
{
_server = new Server();
_connector = new LocalConnector();
_connector.setIntegralPort(9998);
_connector.setIntegralScheme("FTP");
_connector.setConfidentialPort(9999);
_connector.setConfidentialScheme("SPDY");
_connectorS = new LocalConnector()
{
@Override
public void customize(EndPoint endpoint, Request request) throws IOException
{
super.customize(endpoint,request);
request.setScheme(HttpSchemes.HTTPS);
}
@Override
public boolean isIntegral(Request request)
{
return true;
}
@Override
public boolean isConfidential(Request request)
{
return true;
}
};
_server.setConnectors(new Connector[]{_connector,_connectorS});
ContextHandler _context = new ContextHandler();
_session = new SessionHandler();
_context.setContextPath("/ctx");
_server.setHandler(_context);
_context.setHandler(_session);
_security = new ConstraintSecurityHandler();
_session.setHandler(_security);
_security.setHandler(new AbstractHandler()
{
public void handle(String target, Request baseRequest, HttpServletRequest request, HttpServletResponse response) throws IOException, ServletException
{
baseRequest.setHandled(true);
response.sendError(404);
}
});
}
@After
public void stopServer() throws Exception
{
if (_server.isRunning())
{
_server.stop();
_server.join();
}
}
@Test
public void testIntegral() throws Exception
{
Constraint constraint0 = new Constraint();
constraint0.setAuthenticate(false);
constraint0.setName("integral");
constraint0.setDataConstraint(Constraint.DC_INTEGRAL);
ConstraintMapping mapping0 = new ConstraintMapping();
mapping0.setPathSpec("/integral/*");
mapping0.setConstraint(constraint0);
_security.setConstraintMappings(Arrays.asList(new ConstraintMapping[]
{
mapping0
}));
_server.start();
String response;
response = _connector.getResponses("GET /ctx/some/thing HTTP/1.0\r\n\r\n");
assertThat(response, containsString("HTTP/1.1 404 Not Found"));
response = _connector.getResponses("GET /ctx/integral/info HTTP/1.0\r\n\r\n");
assertThat(response, containsString("HTTP/1.1 302 Found"));
assertThat(response, containsString("Location: FTP://"));
assertThat(response, containsString(":9998"));
response = _connectorS.getResponses("GET /ctx/integral/info HTTP/1.0\r\n\r\n");
assertThat(response, containsString("HTTP/1.1 404 Not Found"));
}
@Test
public void testConfidential() throws Exception
{
Constraint constraint0 = new Constraint();
constraint0.setAuthenticate(false);
constraint0.setName("confid");
constraint0.setDataConstraint(Constraint.DC_CONFIDENTIAL);
ConstraintMapping mapping0 = new ConstraintMapping();
mapping0.setPathSpec("/confid/*");
mapping0.setConstraint(constraint0);
_security.setConstraintMappings(Arrays.asList(new ConstraintMapping[]
{
mapping0
}));
_server.start();
String response;
response = _connector.getResponses("GET /ctx/some/thing HTTP/1.0\r\n\r\n");
assertThat(response, containsString("HTTP/1.1 404 Not Found"));
response = _connector.getResponses("GET /ctx/confid/info HTTP/1.0\r\n\r\n");
assertThat(response, containsString("HTTP/1.1 302 Found"));
assertThat(response, containsString("Location: SPDY://"));
assertThat(response, containsString(":9999"));
response = _connectorS.getResponses("GET /ctx/confid/info HTTP/1.0\r\n\r\n");
assertThat(response, containsString("HTTP/1.1 404 Not Found"));
}
}

View File

@ -889,11 +889,10 @@ public abstract class AbstractConnector extends AggregateLifeCycle implements Ht
@Override @Override
public String toString() public String toString()
{ {
return String.format("%s@%s:%d %s", return String.format("%s@%s:%d",
getClass().getSimpleName(), getClass().getSimpleName(),
getHost()==null?"0.0.0.0":getHost(), getHost()==null?"0.0.0.0":getHost(),
getLocalPort()<=0?getPort():getLocalPort(), getLocalPort()<=0?getPort():getLocalPort());
AbstractLifeCycle.getState(this));
} }
/* ------------------------------------------------------------ */ /* ------------------------------------------------------------ */

View File

@ -131,7 +131,7 @@ public class Dispatcher implements RequestDispatcher
public void include(ServletRequest request, ServletResponse response) throws ServletException, IOException public void include(ServletRequest request, ServletResponse response) throws ServletException, IOException
{ {
Request baseRequest=(request instanceof Request)?((Request)request):AbstractHttpConnection.getCurrentConnection().getRequest(); Request baseRequest=(request instanceof Request)?((Request)request):AbstractHttpConnection.getCurrentConnection().getRequest();
request.removeAttribute(__JSP_FILE); // TODO remove when glassfish 1044 is fixed
if (!(request instanceof HttpServletRequest)) if (!(request instanceof HttpServletRequest))
request = new ServletRequestHttpWrapper(request); request = new ServletRequestHttpWrapper(request);
@ -215,7 +215,7 @@ public class Dispatcher implements RequestDispatcher
Response base_response=baseRequest.getResponse(); Response base_response=baseRequest.getResponse();
response.resetBuffer(); response.resetBuffer();
base_response.fwdReset(); base_response.fwdReset();
request.removeAttribute(__JSP_FILE); // TODO remove when glassfish 1044 is fixed
if (!(request instanceof HttpServletRequest)) if (!(request instanceof HttpServletRequest))
request = new ServletRequestHttpWrapper(request); request = new ServletRequestHttpWrapper(request);

View File

@ -94,7 +94,7 @@ public abstract class AbstractHandler extends AggregateLifeCycle implements Hand
/* ------------------------------------------------------------ */ /* ------------------------------------------------------------ */
public void dumpThis(Appendable out) throws IOException public void dumpThis(Appendable out) throws IOException
{ {
out.append(toString()).append(' ').append(getState()).append('\n'); out.append(toString()).append(" - ").append(getState()).append('\n');
} }
} }

View File

@ -113,6 +113,6 @@ public abstract class AbstractHandlerContainer extends AbstractHandler implement
public void dump(Appendable out,String indent) throws IOException public void dump(Appendable out,String indent) throws IOException
{ {
dumpThis(out); dumpThis(out);
dump(out,indent,TypeUtil.asList(getHandlers()),getBeans()); dump(out,indent,getBeans(),TypeUtil.asList(getHandlers()));
} }
} }

View File

@ -448,8 +448,8 @@ public class HttpConnectionTest
PrintWriter writer = response.getWriter(); PrintWriter writer = response.getWriter();
writer.write("<html><h1>FOO</h1></html>"); writer.write("<html><h1>FOO</h1></html>");
writer.flush(); writer.flush();
writer.close(); if (!writer.checkError())
throw new RuntimeException("SHOULD NOT GET HERE"); throw new RuntimeException("SHOULD NOT GET HERE");
} }
catch(Exception e) catch(Exception e)
{ {

View File

@ -31,16 +31,21 @@ import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse; import javax.servlet.http.HttpServletResponse;
import junit.framework.Assert; import junit.framework.Assert;
import org.eclipse.jetty.http.HttpParser;
import org.eclipse.jetty.io.EndPoint; import org.eclipse.jetty.io.EndPoint;
import org.eclipse.jetty.server.handler.AbstractHandler; import org.eclipse.jetty.server.handler.AbstractHandler;
import org.eclipse.jetty.util.IO; import org.eclipse.jetty.util.IO;
import org.eclipse.jetty.util.StringUtil;
import org.eclipse.jetty.util.log.Log; import org.eclipse.jetty.util.log.Log;
import org.eclipse.jetty.util.log.StdErrLog; import org.eclipse.jetty.util.log.StdErrLog;
import org.junit.Test; import org.junit.Test;
import static org.hamcrest.Matchers.greaterThanOrEqualTo;
import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNotSame; import static org.junit.Assert.assertNotSame;
import static org.junit.Assert.assertTrue; import static org.junit.Assert.assertTrue;
import static org.junit.Assert.assertThat;
/** /**
* *
@ -492,7 +497,7 @@ public abstract class HttpServerTestBase extends HttpServerTestFixture
} }
finally finally
{ {
System.err.println("Got "+total+" of "+(512*1024)); //System.err.println("Got "+total+" of "+(512*1024));
client.close(); client.close();
} }
} }
@ -739,7 +744,7 @@ public abstract class HttpServerTestBase extends HttpServerTestFixture
IO.copy(is,bout); IO.copy(is,bout);
byte[] b=bout.toByteArray(); byte[] b=bout.toByteArray();
System.err.println("OUTPUT: "+new String(b)); //System.err.println("OUTPUT: "+new String(b));
int i=0; int i=0;
while (b[i]!='Z') while (b[i]!='Z')
i++; i++;
@ -1205,4 +1210,69 @@ public abstract class HttpServerTestBase extends HttpServerTestFixture
@Test
public void testUnreadInput () throws Exception
{
configureServer(new NoopHandler());
final int REQS=5;
String content="This is a loooooooooooooooooooooooooooooooooo"+
"ooooooooooooooooooooooooooooooooooooooooooooo"+
"ooooooooooooooooooooooooooooooooooooooooooooo"+
"ooooooooooooooooooooooooooooooooooooooooooooo"+
"ooooooooooooooooooooooooooooooooooooooooooooo"+
"ooooooooooooooooooooooooooooooooooooooooooooo"+
"ooooooooooooooooooooooooooooooooooooooooooooo"+
"ooooooooooooooooooooooooooooooooooooooooooooo"+
"ooooooooooooooooooooooooooooooooooooooooooooo"+
"oooooooooooonnnnnnnnnnnnnnnnggggggggg content"+
new String(new char[65*1024]);
final byte[] bytes = content.getBytes();
Socket client=newSocket(HOST,_connector.getLocalPort());
final OutputStream out=client.getOutputStream();
new Thread()
{
public void run()
{
try
{
for (int i=0; i<REQS; i++)
{
out.write("GET / HTTP/1.1\r\nHost: localhost\r\n".getBytes(StringUtil.__ISO_8859_1));
out.write(("Content-Length: "+bytes.length+"\r\n" + "\r\n").getBytes(StringUtil.__ISO_8859_1));
out.write(bytes,0,bytes.length);
}
out.write("GET / HTTP/1.1\r\nHost: localhost\r\nConnection: close\r\n\r\n".getBytes(StringUtil.__ISO_8859_1));
out.flush();
}
catch(Exception e)
{
e.printStackTrace();
}
}
}.start();
String resps = readResponse(client);
int offset=0;
for (int i=0;i<(REQS+1);i++)
{
int ok=resps.indexOf("HTTP/1.1 200 OK",offset);
assertThat("resp"+i,ok,greaterThanOrEqualTo(offset));
offset=ok+15;
}
}
public class NoopHandler extends AbstractHandler
{
public void handle(String target, Request baseRequest,
HttpServletRequest request, HttpServletResponse response) throws IOException,
ServletException
{
//don't read the input, just send something back
((Request)request).setHandled(true);
response.setStatus(200);
}
}
} }

View File

@ -1,118 +0,0 @@
// ========================================================================
// Copyright (c) 2008-2009 Mort Bay Consulting Pty. Ltd.
// ------------------------------------------------------------------------
// All rights reserved. This program and the accompanying materials
// are made available under the terms of the Eclipse Public License v1.0
// and Apache License v2.0 which accompanies this distribution.
// The Eclipse Public License is available at
// http://www.eclipse.org/legal/epl-v10.html
// The Apache License v2.0 is available at
// http://www.opensource.org/licenses/apache2.0.php
// You may elect to redistribute this code under either of these licenses.
// ========================================================================
package org.eclipse.jetty.server;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.net.Socket;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import org.eclipse.jetty.server.bio.SocketConnector;
import org.eclipse.jetty.server.handler.AbstractHandler;
import org.junit.After;
import org.junit.Before;
import org.junit.Test;
public class UnreadInputTest
{
public static final String __OK_RESPONSE = "HTTP/1.1 200 OK\r\nContent-Length: 0\r\nServer: Jetty(7.0.x)\r\n\r\n";
protected Server _server = new Server();
protected SocketConnector _connector;
protected int _port;
protected Socket _socket;
protected OutputStream _outputStream;
protected InputStream _inputStream;
@Before
public void init() throws Exception
{
//server side
_connector = new SocketConnector();
_server.setConnectors(new Connector[]{ _connector });
_server.setHandler(new NoopHandler());
_server.start();
_port = _connector.getLocalPort();
//client side
_socket = new Socket((String)null, _port);
_outputStream = _socket.getOutputStream();
_inputStream = _socket.getInputStream();
}
@After
public void destroy() throws Exception
{
_socket.close();
_server.stop();
_server.join();
}
@Test
public void testUnreadInput () throws Exception
{
for (int i=0; i<2; i++)
{
String content = "This is a loooooooooooooooooooooooooooooooooo"+
"ooooooooooooooooooooooooooooooooooooooooooooo"+
"ooooooooooooooooooooooooooooooooooooooooooooo"+
"ooooooooooooooooooooooooooooooooooooooooooooo"+
"ooooooooooooooooooooooooooooooooooooooooooooo"+
"ooooooooooooooooooooooooooooooooooooooooooooo"+
"ooooooooooooooooooooooooooooooooooooooooooooo"+
"ooooooooooooooooooooooooooooooooooooooooooooo"+
"ooooooooooooooooooooooooooooooooooooooooooooo"+
"ooooooooooooooooooooooonnnnnnnnnnnnnnnnggggggggg content";
byte[] bytes = content.getBytes();
_outputStream.write("GET / HTTP/1.1\r\nHost: localhost\r\n".getBytes());
Thread.currentThread();
Thread.sleep(500L);
String str = "Content-Length: "+bytes.length+"\r\n" + "\r\n";
_outputStream.write(str.getBytes());
Thread.currentThread();
Thread.sleep(500L);
//write some bytes of the content
_outputStream.write(bytes, 0, (bytes.length/2));
Thread.currentThread();
Thread.sleep(1000L);
//write the rest
_outputStream.write(bytes, bytes.length/2, (bytes.length - bytes.length/2));
}
byte[] inbuf = new byte[__OK_RESPONSE.getBytes().length*2];
int x = _inputStream.read(inbuf);
System.err.println(new String(inbuf, 0, x));
}
public class NoopHandler extends AbstractHandler
{
public void handle(String target, Request baseRequest,
HttpServletRequest request, HttpServletResponse response) throws IOException,
ServletException
{
//don't read the input, just send something back
((Request)request).setHandled(true);
response.setStatus(200);
}
}
}

View File

@ -260,7 +260,8 @@ public class Holder<T> extends AbstractLifeCycle implements Dumpable
/* ------------------------------------------------------------ */ /* ------------------------------------------------------------ */
public void dump(Appendable out, String indent) throws IOException public void dump(Appendable out, String indent) throws IOException
{ {
out.append(_name).append("==").append(_className).append("\n"); out.append(_name).append("==").append(_className)
.append(" - ").append(AbstractLifeCycle.getState(this)).append("\n");
AggregateLifeCycle.dump(out,indent,_initParams.entrySet()); AggregateLifeCycle.dump(out,indent,_initParams.entrySet());
} }

View File

@ -209,9 +209,4 @@ public abstract class AbstractLifeCycle implements LifeCycle
public void lifeCycleStopped(LifeCycle event) {} public void lifeCycleStopped(LifeCycle event) {}
public void lifeCycleStopping(LifeCycle event) {} public void lifeCycleStopping(LifeCycle event) {}
} }
public String toString()
{
return super.toString()+"#"+getState();
}
} }

View File

@ -339,7 +339,16 @@ public class AggregateLifeCycle extends AbstractLifeCycle implements Destroyable
/* ------------------------------------------------------------ */ /* ------------------------------------------------------------ */
protected void dumpThis(Appendable out) throws IOException protected void dumpThis(Appendable out) throws IOException
{ {
out.append(String.valueOf(this)).append("\n"); out.append(String.valueOf(this)).append(" - ").append(getState()).append("\n");
}
/* ------------------------------------------------------------ */
public static void dumpObject(Appendable out,Object o) throws IOException
{
if (o instanceof LifeCycle)
out.append(String.valueOf(o)).append(" - ").append((AbstractLifeCycle.getState((LifeCycle)o))).append("\n");
else
out.append(String.valueOf(o)).append("\n");
} }
/* ------------------------------------------------------------ */ /* ------------------------------------------------------------ */
@ -359,15 +368,11 @@ public class AggregateLifeCycle extends AbstractLifeCycle implements Destroyable
out.append(indent).append(" +- "); out.append(indent).append(" +- ");
if (b._bean instanceof Dumpable) if (b._bean instanceof Dumpable)
((Dumpable)b._bean).dump(out,indent+(i==size?" ":" | ")); ((Dumpable)b._bean).dump(out,indent+(i==size?" ":" | "));
else else
out.append(String.valueOf(b._bean)).append("\n"); dumpObject(out,b._bean);
} }
else else
{ dumpObject(out,b._bean);
out.append(indent).append(" +~ ");
out.append(String.valueOf(b._bean)).append("\n");
}
} }
if (i!=size) if (i!=size)
@ -395,16 +400,12 @@ public class AggregateLifeCycle extends AbstractLifeCycle implements Destroyable
if (o instanceof Dumpable) if (o instanceof Dumpable)
((Dumpable)o).dump(out,indent+(i==size?" ":" | ")); ((Dumpable)o).dump(out,indent+(i==size?" ":" | "));
else else
out.append(String.valueOf(o)).append("\n"); dumpObject(out,o);
} }
if (i!=size) if (i!=size)
out.append(indent).append(" |\n"); out.append(indent).append(" |\n");
} }
} }
} }

View File

@ -1524,11 +1524,10 @@ public class SslContextFactory extends AbstractLifeCycle
/* ------------------------------------------------------------ */ /* ------------------------------------------------------------ */
public String toString() public String toString()
{ {
return String.format("%s@%x(%s,%s)#%s", return String.format("%s@%x(%s,%s)",
getClass().getSimpleName(), getClass().getSimpleName(),
hashCode(), hashCode(),
_keyStorePath, _keyStorePath,
_trustStorePath, _trustStorePath);
getState());
} }
} }

View File

@ -498,7 +498,7 @@ public class QueuedThreadPool extends AbstractLifeCycle implements SizedThreadPo
} }
} }
out.append(String.valueOf(this)).append("\n"); AggregateLifeCycle.dumpObject(out,this);
AggregateLifeCycle.dump(out,indent,dump); AggregateLifeCycle.dump(out,indent,dump);
} }
@ -508,7 +508,7 @@ public class QueuedThreadPool extends AbstractLifeCycle implements SizedThreadPo
@Override @Override
public String toString() public String toString()
{ {
return _name+"{"+getMinThreads()+"<="+getIdleThreads()+"<="+getThreads()+"/"+getMaxThreads()+","+(_jobs==null?-1:_jobs.size())+"}#"+getState(); return _name+"{"+getMinThreads()+"<="+getIdleThreads()+"<="+getThreads()+"/"+getMaxThreads()+","+(_jobs==null?-1:_jobs.size())+"}";
} }
/* ------------------------------------------------------------ */ /* ------------------------------------------------------------ */

View File

@ -15,6 +15,9 @@
*******************************************************************************/ *******************************************************************************/
package org.eclipse.jetty.websocket; package org.eclipse.jetty.websocket;
import static org.hamcrest.Matchers.*;
import static org.junit.Assert.*;
import java.io.EOFException; import java.io.EOFException;
import java.io.IOException; import java.io.IOException;
import java.io.InputStream; import java.io.InputStream;
@ -28,9 +31,9 @@ import java.util.concurrent.atomic.AtomicLong;
import java.util.concurrent.atomic.AtomicReference; import java.util.concurrent.atomic.AtomicReference;
import java.util.zip.Deflater; import java.util.zip.Deflater;
import java.util.zip.Inflater; import java.util.zip.Inflater;
import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletRequest;
import junit.framework.Assert;
import org.eclipse.jetty.io.Buffer; import org.eclipse.jetty.io.Buffer;
import org.eclipse.jetty.io.ByteArrayEndPoint; import org.eclipse.jetty.io.ByteArrayEndPoint;
import org.eclipse.jetty.server.Connector; import org.eclipse.jetty.server.Connector;
@ -41,13 +44,10 @@ import org.eclipse.jetty.util.StringUtil;
import org.eclipse.jetty.util.TypeUtil; import org.eclipse.jetty.util.TypeUtil;
import org.eclipse.jetty.util.Utf8StringBuilder; import org.eclipse.jetty.util.Utf8StringBuilder;
import org.junit.AfterClass; import org.junit.AfterClass;
import org.junit.Assert;
import org.junit.BeforeClass; import org.junit.BeforeClass;
import org.junit.Test; import org.junit.Test;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.assertTrue;
public class WebSocketMessageRFC6455Test public class WebSocketMessageRFC6455Test
{ {
private static Server __server; private static Server __server;
@ -606,7 +606,7 @@ public class WebSocketMessageRFC6455Test
Thread.sleep(100); Thread.sleep(100);
assertEquals(count*(mesg.length()+2),totalB.get()); // all messages assertEquals(count*(mesg.length()+2),totalB.get()); // all messages
assertTrue(max>1000); // was blocked Assert.assertThat("Was blocked (max time)", max, greaterThan(1000L)); // was blocked
} }
@Test @Test

View File

@ -111,21 +111,22 @@ public class XmlConfiguration
try try
{ {
URL config60 = Loader.getResource(XmlConfiguration.class,"org/eclipse/jetty/xml/configure_6_0.dtd",true); URL config60 = Loader.getResource(XmlConfiguration.class,"org/eclipse/jetty/xml/configure_6_0.dtd",true);
URL config71 = Loader.getResource(XmlConfiguration.class,"org/eclipse/jetty/xml/configure_7_1.dtd",true); URL config76 = Loader.getResource(XmlConfiguration.class,"org/eclipse/jetty/xml/configure_7_6.dtd",true);
__parser.redirectEntity("configure.dtd",config71); __parser.redirectEntity("configure.dtd",config76);
__parser.redirectEntity("configure_1_0.dtd",config60); __parser.redirectEntity("configure_1_0.dtd",config60);
__parser.redirectEntity("configure_1_1.dtd",config60); __parser.redirectEntity("configure_1_1.dtd",config60);
__parser.redirectEntity("configure_1_2.dtd",config60); __parser.redirectEntity("configure_1_2.dtd",config60);
__parser.redirectEntity("configure_1_3.dtd",config60); __parser.redirectEntity("configure_1_3.dtd",config60);
__parser.redirectEntity("configure_6_0.dtd",config60); __parser.redirectEntity("configure_6_0.dtd",config60);
__parser.redirectEntity("configure_7_1.dtd",config71); __parser.redirectEntity("configure_7_6.dtd",config76);
__parser.redirectEntity("http://jetty.mortbay.org/configure.dtd",config71);
__parser.redirectEntity("http://jetty.eclipse.org/configure.dtd",config71); __parser.redirectEntity("http://jetty.mortbay.org/configure.dtd",config76);
__parser.redirectEntity("http://www.eclipse.org/jetty/configure.dtd",config71); __parser.redirectEntity("http://jetty.eclipse.org/configure.dtd",config76);
__parser.redirectEntity("http://www.eclipse.org/jetty/configure.dtd",config76);
__parser.redirectEntity("-//Mort Bay Consulting//DTD Configure//EN",config71); __parser.redirectEntity("-//Mort Bay Consulting//DTD Configure//EN",config76);
__parser.redirectEntity("-//Jetty//Configure//EN",config71); __parser.redirectEntity("-//Jetty//Configure//EN",config76);
} }
catch (ClassNotFoundException e) catch (ClassNotFoundException e)
{ {

View File

@ -25,6 +25,14 @@ import org.junit.Test;
public class XmlConfigurationTest public class XmlConfigurationTest
{ {
protected String _configure="org/eclipse/jetty/xml/configure.xml"; protected String _configure="org/eclipse/jetty/xml/configure.xml";
@Test
public void testMortBay() throws Exception
{
URL url = XmlConfigurationTest.class.getClassLoader().getResource("org/eclipse/jetty/xml/mortbay.xml");
XmlConfiguration configuration = new XmlConfiguration(url);
Object o=configuration.configure();
}
@Test @Test
public void testPassedObject() throws Exception public void testPassedObject() throws Exception

View File

@ -1,5 +1,5 @@
<?xml version="1.0" encoding="ISO-8859-1"?> <?xml version="1.0" encoding="ISO-8859-1"?>
<!DOCTYPE Configure PUBLIC "-//Mort Bay Consulting//DTD Configure 1.2//EN" "http://www.eclipse.org/jetty/configure_1_2.dtd"> <!DOCTYPE Configure PUBLIC "-//Mort Bay Consulting//DTD Configure//EN" "http://www.eclipse.org/jetty/configure.dtd">
<Configure class="org.eclipse.jetty.xml.TestConfiguration"> <Configure class="org.eclipse.jetty.xml.TestConfiguration">

View File

@ -0,0 +1,4 @@
<?xml version="1.0" encoding="ISO-8859-1"?>
<!DOCTYPE Configure PUBLIC "-//Mort Bay Consulting//DTD Configure//EN" "http://jetty.mortbay.org/configure.dtd">
<Configure class="java.lang.Object">
</Configure>

View File

@ -11,7 +11,6 @@
<url>${jetty.url}</url> <url>${jetty.url}</url>
<packaging>pom</packaging> <packaging>pom</packaging>
<properties> <properties>
<javax-activation-version>1.1</javax-activation-version>
<javax-mail-version>1.4.1</javax-mail-version> <javax-mail-version>1.4.1</javax-mail-version>
<javax-servlet-jsp-version>2.1.v20100127</javax-servlet-jsp-version> <javax-servlet-jsp-version>2.1.v20100127</javax-servlet-jsp-version>
<javax-transaction-version>1.1.1</javax-transaction-version> <javax-transaction-version>1.1.1</javax-transaction-version>
@ -402,11 +401,6 @@
<artifactId>mail</artifactId> <artifactId>mail</artifactId>
<version>${javax-mail-version}</version> <version>${javax-mail-version}</version>
</dependency> </dependency>
<dependency>
<groupId>javax.activation</groupId>
<artifactId>activation</artifactId>
<version>${javax-activation-version}</version>
</dependency>
<dependency> <dependency>
<groupId>junit</groupId> <groupId>junit</groupId>
<artifactId>junit</artifactId> <artifactId>junit</artifactId>

View File

@ -16,8 +16,8 @@
package org.eclipse.jetty.test.rfcs; package org.eclipse.jetty.test.rfcs;
import static org.junit.Assert.assertThat; import static org.junit.Assert.*;
import static org.junit.matchers.JUnitMatchers.containsString; import static org.junit.matchers.JUnitMatchers.*;
import java.io.File; import java.io.File;
import java.io.IOException; import java.io.IOException;
@ -42,6 +42,7 @@ import org.eclipse.jetty.toolchain.test.StringAssert;
import org.junit.AfterClass; import org.junit.AfterClass;
import org.junit.Assert; import org.junit.Assert;
import org.junit.Before; import org.junit.Before;
import org.junit.Ignore;
import org.junit.Test; import org.junit.Test;
/** /**
@ -955,6 +956,7 @@ public abstract class RFC2616BaseTest
* @see <a href="http://tools.ietf.org/html/rfc2616#section-9.8">RFC 2616 (section 9.8)</a> * @see <a href="http://tools.ietf.org/html/rfc2616#section-9.8">RFC 2616 (section 9.8)</a>
*/ */
@Test @Test
@Ignore("Introduction of fix for realm-less security constraints has rendered this test invalid due to default configuration preventing use of TRACE in webdefault.xml")
public void test9_8() throws Exception public void test9_8() throws Exception
{ {

View File

@ -1,5 +1,5 @@
<?xml version="1.0" encoding="ISO-8859-1"?> <?xml version="1.0" encoding="ISO-8859-1"?>
<!DOCTYPE Configure PUBLIC "-//Mort Bay Consulting//DTD Configure//EN" "http://jetty.mortbay.org/configure.dtd"> <!DOCTYPE Configure PUBLIC "-//Mort Bay Consulting//DTD Configure//EN" "http://www.eclipse.org/jetty/configure.dtd">
<Configure class="org.eclipse.jetty.webapp.WebAppContext"> <Configure class="org.eclipse.jetty.webapp.WebAppContext">
<Set name="contextPath">/rfc2616-webapp</Set> <Set name="contextPath">/rfc2616-webapp</Set>
<Set name="war"> <Set name="war">