mirror of
https://github.com/scm-manager/scm-manager.git
synced 2025-11-16 18:26:16 +01:00
fix anonymous access
This commit is contained in:
@@ -120,16 +120,15 @@ public class BasicAuthenticationFilter extends HttpFilter
|
|||||||
User user = null;
|
User user = null;
|
||||||
String authentication = request.getHeader(HEADER_AUTHORIZATION);
|
String authentication = request.getHeader(HEADER_AUTHORIZATION);
|
||||||
|
|
||||||
if (securityContext.isAuthenticated())
|
if (Util.isNotEmpty(authentication)
|
||||||
{
|
&& authentication.toUpperCase().startsWith(AUTHORIZATION_BASIC_PREFIX))
|
||||||
user = securityContext.getUser();
|
|
||||||
}
|
|
||||||
else if (Util.isNotEmpty(authentication)
|
|
||||||
&& authentication.toUpperCase().startsWith(
|
|
||||||
AUTHORIZATION_BASIC_PREFIX))
|
|
||||||
{
|
{
|
||||||
user = authenticate(request, response, securityContext, authentication);
|
user = authenticate(request, response, securityContext, authentication);
|
||||||
}
|
}
|
||||||
|
else if (securityContext.isAuthenticated())
|
||||||
|
{
|
||||||
|
user = securityContext.getUser();
|
||||||
|
}
|
||||||
|
|
||||||
if (user == null)
|
if (user == null)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -182,7 +182,6 @@ public class AnonymousAccessITCase
|
|||||||
* @throws RepositoryClientException
|
* @throws RepositoryClientException
|
||||||
*/
|
*/
|
||||||
@Test
|
@Test
|
||||||
@Ignore
|
|
||||||
public void testSimpleAdminPush()
|
public void testSimpleAdminPush()
|
||||||
throws RepositoryClientException, IOException
|
throws RepositoryClientException, IOException
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user