merge with branch 1.x

This commit is contained in:
Sebastian Sdorra
2017-01-12 19:50:39 +01:00
250 changed files with 16399 additions and 1573 deletions

View File

@@ -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();

View File

@@ -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);

View File

@@ -1111,7 +1111,7 @@ public class RepositoryResource
*/
private String getContentDispositionName(String name)
{
return "attachment; filename=\"".concat(name).concat("\"");
return HttpUtil.createContentDispositionAttachmentHeader(name);
}
/**