mirror of
https://github.com/jetty/jetty.project.git
synced 2025-03-01 11:29:29 +00:00
Signed-off-by: Greg Wilkins <gregw@webtide.com>
This commit is contained in:
parent
bb0c558128
commit
5e583fa9f3
@ -316,7 +316,7 @@ public class Request implements HttpServletRequest
|
||||
|
||||
HttpField authField = getHttpFields().getField(HttpHeader.AUTHORIZATION);
|
||||
//TODO check what to do for digest etc etc
|
||||
if (getUserPrincipal() != null && authField.getValue().startsWith("Basic"))
|
||||
if (authField != null && getUserPrincipal() != null && authField.getValue().startsWith("Basic"))
|
||||
fields.add(authField);
|
||||
|
||||
String id;
|
||||
|
@ -1873,6 +1873,25 @@ public class RequestTest
|
||||
assertThat(builder.getHeader("Cookie"), not(containsString("bad")));
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testPushBuilderWithIdNoAuth() throws Exception
|
||||
{
|
||||
String uri = "/foo/something";
|
||||
Request request = new TestRequest(null, null)
|
||||
{
|
||||
@Override
|
||||
public Principal getUserPrincipal()
|
||||
{
|
||||
return () -> "test";
|
||||
}
|
||||
};
|
||||
HttpFields.Mutable fields = HttpFields.build();
|
||||
request.setMetaData(new MetaData.Request("GET", HttpURI.from(uri), HttpVersion.HTTP_1_0, fields));
|
||||
assertTrue(request.isPushSupported());
|
||||
PushBuilder builder = request.newPushBuilder();
|
||||
assertNotNull(builder);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testServletPathMapping() throws Exception
|
||||
{
|
||||
|
Loading…
x
Reference in New Issue
Block a user