mirror of https://github.com/apache/archiva.git
[MRM-781] correct probem with guest account
Submitted by: James William Dumay git-svn-id: https://svn.apache.org/repos/asf/archiva/trunk@649748 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
3066bec070
commit
c2c71dd5ec
|
@ -121,7 +121,9 @@ public class RepositoryServlet
|
|||
}
|
||||
catch (DavException e) {
|
||||
if (e.getErrorCode() == HttpServletResponse.SC_UNAUTHORIZED) {
|
||||
log.error("Should throw UnauthorizedDavException");
|
||||
final String msg = "Should throw " + UnauthorizedDavException.class.getName();
|
||||
log.error(msg);
|
||||
webdavResponse.sendError(e.getErrorCode(), msg);
|
||||
} else {
|
||||
webdavResponse.sendError(e);
|
||||
}
|
||||
|
|
|
@ -79,10 +79,9 @@ public class ArchivaDavSessionProvider implements DavSessionProvider
|
|||
{
|
||||
AuthenticationResult result = httpAuth.getAuthenticationResult( request, null );
|
||||
|
||||
if ( result == null || !result.isAuthenticated() )
|
||||
if ( result != null && !result.isAuthenticated() )
|
||||
{
|
||||
//Unfortunatly, the DavSessionProvider does not pass in the response
|
||||
httpAuth.authenticate(request, null);
|
||||
throw new UnauthorizedDavException(repositoryId, "User Credentials Invalid");
|
||||
}
|
||||
}
|
||||
catch ( AuthenticationException e )
|
||||
|
@ -130,7 +129,7 @@ public class ArchivaDavSessionProvider implements DavSessionProvider
|
|||
",permission=" + permission + ",repo=" + repositoryId + "] : " +
|
||||
authzResult.getException().getMessage() );
|
||||
}
|
||||
throw new DavException(HttpServletResponse.SC_UNAUTHORIZED, "Access denied for repository " + repositoryId);
|
||||
throw new UnauthorizedDavException(repositoryId, "Access denied for repository " + repositoryId);
|
||||
}
|
||||
}
|
||||
catch ( AuthorizationException e )
|
||||
|
|
Loading…
Reference in New Issue