mirror of
https://github.com/scm-manager/scm-manager.git
synced 2025-11-06 21:45:43 +01:00
use base uri from request for git quick repository view, see issue #631
This commit is contained in:
@@ -44,7 +44,6 @@ import com.google.inject.Inject;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
import sonia.scm.config.ScmConfiguration;
|
||||
import sonia.scm.repository.Branch;
|
||||
import sonia.scm.repository.Branches;
|
||||
import sonia.scm.repository.Changeset;
|
||||
@@ -60,6 +59,7 @@ import sonia.scm.template.TemplateEngineFactory;
|
||||
import sonia.scm.url.RepositoryUrlProvider;
|
||||
import sonia.scm.url.UrlProvider;
|
||||
import sonia.scm.url.UrlProviderFactory;
|
||||
import sonia.scm.util.HttpUtil;
|
||||
import sonia.scm.util.Util;
|
||||
|
||||
//~--- JDK imports ------------------------------------------------------------
|
||||
@@ -84,7 +84,8 @@ public class GitRepositoryViewer
|
||||
public static final String MIMETYPE_HTML = "text/html";
|
||||
|
||||
/** Field description */
|
||||
public static final String RESOURCE_GITINDEX = "/sonia/scm/git.index.mustache";
|
||||
public static final String RESOURCE_GITINDEX =
|
||||
"/sonia/scm/git.index.mustache";
|
||||
|
||||
/** Field description */
|
||||
private static final int CHANGESET_PER_BRANCH = 10;
|
||||
@@ -103,16 +104,13 @@ public class GitRepositoryViewer
|
||||
*
|
||||
* @param templateEngineFactory
|
||||
* @param repositoryServiceFactory
|
||||
* @param configuration
|
||||
*/
|
||||
@Inject
|
||||
public GitRepositoryViewer(TemplateEngineFactory templateEngineFactory,
|
||||
RepositoryServiceFactory repositoryServiceFactory,
|
||||
ScmConfiguration configuration)
|
||||
RepositoryServiceFactory repositoryServiceFactory)
|
||||
{
|
||||
this.templateEngineFactory = templateEngineFactory;
|
||||
this.repositoryServiceFactory = repositoryServiceFactory;
|
||||
this.configuration = configuration;
|
||||
}
|
||||
|
||||
//~--- methods --------------------------------------------------------------
|
||||
@@ -134,7 +132,9 @@ public class GitRepositoryViewer
|
||||
throws RepositoryException, IOException
|
||||
{
|
||||
|
||||
String baseUrl = configuration.getBaseUrl();
|
||||
String baseUrl = HttpUtil.getCompleteUrl(request);
|
||||
|
||||
logger.trace("render git repository quick view with base url {}", baseUrl);
|
||||
|
||||
UrlProvider urlProvider = UrlProviderFactory.createUrlProvider(baseUrl,
|
||||
UrlProviderFactory.TYPE_WUI);
|
||||
@@ -452,9 +452,6 @@ public class GitRepositoryViewer
|
||||
|
||||
//~--- fields ---------------------------------------------------------------
|
||||
|
||||
/** Field description */
|
||||
private final ScmConfiguration configuration;
|
||||
|
||||
/** Field description */
|
||||
private final RepositoryServiceFactory repositoryServiceFactory;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user