mirror of
https://github.com/scm-manager/scm-manager.git
synced 2025-11-11 16:05:44 +01:00
merge with branch 1.x
This commit is contained in:
@@ -83,6 +83,7 @@ import javax.ws.rs.core.Response;
|
||||
import javax.xml.bind.annotation.XmlAccessType;
|
||||
import javax.xml.bind.annotation.XmlAccessorType;
|
||||
import javax.xml.bind.annotation.XmlRootElement;
|
||||
import sonia.scm.security.XsrfCookies;
|
||||
|
||||
/**
|
||||
*
|
||||
@@ -266,6 +267,9 @@ public class AuthenticationResource
|
||||
public Response logout(@Context HttpServletRequest request,
|
||||
@Context HttpServletResponse response)
|
||||
{
|
||||
// remove xsrf token
|
||||
XsrfCookies.remove(request, response);
|
||||
|
||||
Subject subject = SecurityUtils.getSubject();
|
||||
|
||||
subject.logout();
|
||||
|
||||
@@ -553,7 +553,8 @@ public class RepositoryImportResource
|
||||
}
|
||||
catch (RepositoryAlreadyExistsException ex)
|
||||
{
|
||||
logger.warn("a {} repository with the name {} already exists", ex);
|
||||
logger.warn("a {} repository with the name {} already exists", type,
|
||||
name);
|
||||
|
||||
throw new WebApplicationException(Response.Status.CONFLICT);
|
||||
}
|
||||
@@ -692,7 +693,7 @@ public class RepositoryImportResource
|
||||
private void handleGenericCreationFailure(Exception ex, String type,
|
||||
String name)
|
||||
{
|
||||
logger.error(String.format("could not create repository {} with type {}",
|
||||
logger.error(String.format("could not create repository %s with type %s",
|
||||
type, name), ex);
|
||||
|
||||
throw new WebApplicationException(ex);
|
||||
|
||||
@@ -1111,7 +1111,7 @@ public class RepositoryResource
|
||||
*/
|
||||
private String getContentDispositionName(String name)
|
||||
{
|
||||
return "attachment; filename=\"".concat(name).concat("\"");
|
||||
return HttpUtil.createContentDispositionAttachmentHeader(name);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user