James Moger
2014-03-18 23c416f30f4a1e69e76b70d71f6a9a7da4a020f1
src/main/java/com/gitblit/git/GitblitReceivePackFactory.java
@@ -32,7 +32,7 @@
import com.gitblit.models.RepositoryModel;
import com.gitblit.models.UserModel;
import com.gitblit.transport.git.GitDaemonClient;
import com.gitblit.transport.ssh.SshSession;
import com.gitblit.transport.ssh.SshDaemonClient;
import com.gitblit.utils.HttpUtils;
import com.gitblit.utils.StringUtils;
@@ -69,13 +69,13 @@
      if (req instanceof HttpServletRequest) {
         // http/https request may or may not be authenticated
         HttpServletRequest request = (HttpServletRequest) req;
         repositoryName = request.getAttribute("gitblitRepositoryName").toString();
         origin = request.getRemoteHost();
         gitblitUrl = HttpUtils.getGitblitURL(request);
         HttpServletRequest client = (HttpServletRequest) req;
         repositoryName = client.getAttribute("gitblitRepositoryName").toString();
         origin = client.getRemoteHost();
         gitblitUrl = HttpUtils.getGitblitURL(client);
         // determine pushing user
         String username = request.getRemoteUser();
         String username = client.getRemoteUser();
         if (!StringUtils.isEmpty(username)) {
            UserModel u = gitblit.getUserModel(username);
            if (u != null) {
@@ -90,13 +90,12 @@
         // set timeout from Git daemon
         timeout = client.getDaemon().getTimeout();
      } else if (req instanceof SshSession) {
      } else if (req instanceof SshDaemonClient) {
         // SSH request is always authenticated
         SshSession s = (SshSession) req;
         repositoryName = s.getRepositoryName();
         origin = s.getRemoteAddress().toString();
         String username = s.getRemoteUser();
         user = gitblit.getUserModel(username);
         SshDaemonClient client = (SshDaemonClient) req;
         repositoryName = client.getRepositoryName();
         origin = client.getRemoteAddress().toString();
         user = client.getUser();
      }
      boolean allowAnonymousPushes = settings.getBoolean(Keys.git.allowAnonymousPushes, false);