James Moger
2014-03-14 8384e02b7d6f1a1ecd6782c6b5f682c109cd6e04
src/main/java/com/gitblit/git/GitblitReceivePackFactory.java
@@ -31,6 +31,7 @@
import com.gitblit.manager.IGitblit;
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.utils.HttpUtils;
import com.gitblit.utils.StringUtils;
@@ -68,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) {
@@ -91,10 +92,10 @@
         timeout = client.getDaemon().getTimeout();
      } else if (req instanceof SshSession) {
         // SSH request is always authenticated
         SshSession s = (SshSession) req;
         repositoryName = s.getRepositoryName();
         origin = s.getRemoteAddress().toString();
         String username = s.getRemoteUser();
         SshSession client = (SshSession) req;
         repositoryName = client.getRepositoryName();
         origin = client.getRemoteAddress().toString();
         String username = client.getRemoteUser();
         user = gitblit.getUserModel(username);
      }