mirror of
https://github.com/scm-manager/scm-manager.git
synced 2025-11-10 15:35:49 +01:00
fix anonymous push to public mercurial repositories
This commit is contained in:
@@ -49,6 +49,7 @@ import sonia.scm.repository.Repository;
|
|||||||
import sonia.scm.repository.RepositoryProvider;
|
import sonia.scm.repository.RepositoryProvider;
|
||||||
import sonia.scm.repository.RepositoryRequestListenerUtil;
|
import sonia.scm.repository.RepositoryRequestListenerUtil;
|
||||||
import sonia.scm.util.AssertUtil;
|
import sonia.scm.util.AssertUtil;
|
||||||
|
import sonia.scm.util.Util;
|
||||||
import sonia.scm.web.cgi.CGIExecutor;
|
import sonia.scm.web.cgi.CGIExecutor;
|
||||||
import sonia.scm.web.cgi.CGIExecutorFactory;
|
import sonia.scm.web.cgi.CGIExecutorFactory;
|
||||||
import sonia.scm.web.cgi.EnvList;
|
import sonia.scm.web.cgi.EnvList;
|
||||||
@@ -86,6 +87,9 @@ public class HgCGIServlet extends HttpServlet
|
|||||||
/** Field description */
|
/** Field description */
|
||||||
public static final String ENV_SESSION_PREFIX = "SCM_";
|
public static final String ENV_SESSION_PREFIX = "SCM_";
|
||||||
|
|
||||||
|
/** Field description */
|
||||||
|
public static final String SCM_CREDENTIALS = "SCM_CREDENTIALS";
|
||||||
|
|
||||||
/** Field description */
|
/** Field description */
|
||||||
private static final long serialVersionUID = -3492811300905099810L;
|
private static final long serialVersionUID = -3492811300905099810L;
|
||||||
|
|
||||||
@@ -191,6 +195,12 @@ public class HgCGIServlet extends HttpServlet
|
|||||||
env.set(key, session.getAttribute(key).toString());
|
env.set(key, session.getAttribute(key).toString());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// issue-97
|
||||||
|
if (!env.containsKey(SCM_CREDENTIALS))
|
||||||
|
{
|
||||||
|
env.set(SCM_CREDENTIALS, Util.EMPTY_STRING);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
Reference in New Issue
Block a user