mirror of
https://github.com/scm-manager/scm-manager.git
synced 2025-11-09 15:05:44 +01:00
send redirect for root repository urls only if the name of the repository is empty
This commit is contained in:
@@ -35,6 +35,7 @@ package sonia.scm.repository;
|
||||
|
||||
//~--- non-JDK imports --------------------------------------------------------
|
||||
|
||||
import com.google.common.base.Strings;
|
||||
import com.google.inject.Inject;
|
||||
import com.google.inject.Provider;
|
||||
import com.google.inject.Singleton;
|
||||
@@ -42,6 +43,7 @@ import com.google.inject.Singleton;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
import sonia.scm.ArgumentIsInvalidException;
|
||||
import sonia.scm.ConfigurationException;
|
||||
import sonia.scm.HandlerEvent;
|
||||
import sonia.scm.SCMContextProvider;
|
||||
@@ -661,8 +663,15 @@ public class DefaultRepositoryManager extends AbstractRepositoryManager
|
||||
@Override
|
||||
public Repository getFromTypeAndUri(String type, String uri)
|
||||
{
|
||||
AssertUtil.assertIsNotEmpty(type);
|
||||
AssertUtil.assertIsNotEmpty(uri);
|
||||
if (Strings.isNullOrEmpty(type))
|
||||
{
|
||||
throw new ArgumentIsInvalidException("argument type is required");
|
||||
}
|
||||
|
||||
if (Strings.isNullOrEmpty(uri))
|
||||
{
|
||||
throw new ArgumentIsInvalidException("argument uri is required");
|
||||
}
|
||||
|
||||
// remove ;jsessionid, jetty bug?
|
||||
uri = HttpUtil.removeMatrixParameter(uri);
|
||||
|
||||
Reference in New Issue
Block a user