From aef641827cc526be8786287520fd143c8b1f9a9f Mon Sep 17 00:00:00 2001 From: kohsuke Date: Mon, 2 Jun 2008 16:50:59 +0000 Subject: [PATCH] [FIXED HUDSON-1767] no absolute URLs in HTML rendering. Fixed in1.221. git-svn-id: https://hudson.dev.java.net/svn/hudson/trunk/hudson/main@9755 71c3de6d-444a-0410-be80-ed276b4c234a --- core/src/main/java/hudson/model/Item.java | 6 ++++++ core/src/main/java/hudson/model/Run.java | 9 +++++++++ .../tasks/test/AbstractTestResultAction/summary.jelly | 2 +- .../hudson/tasks/test/MatrixTestResult/index.jelly | 6 +++--- 4 files changed, 19 insertions(+), 4 deletions(-) diff --git a/core/src/main/java/hudson/model/Item.java b/core/src/main/java/hudson/model/Item.java index ff29f4afd1..8e1a48c453 100644 --- a/core/src/main/java/hudson/model/Item.java +++ b/core/src/main/java/hudson/model/Item.java @@ -125,6 +125,12 @@ public interface Item extends PersistenceRoot, SearchableModelObject { * absolute URL. * @throws IllegalStateException * if the method is invoked outside the HTTP request processing. + * + * @deprecated + * This method shall NEVER be used during HTML page rendering, as it won't work with + * network set up like Apache reverse proxy. + * This method is only intended for the remote API clients who cannot resolve relative references + * (even this won't work for the same reason, which should be fixed.) */ String getAbsoluteUrl(); diff --git a/core/src/main/java/hudson/model/Run.java b/core/src/main/java/hudson/model/Run.java index 782b951b2d..2d440111ab 100644 --- a/core/src/main/java/hudson/model/Run.java +++ b/core/src/main/java/hudson/model/Run.java @@ -455,6 +455,15 @@ public abstract class Run ,RunT extends RunNEVER be used during HTML page rendering, as it won't work with + * network set up like Apache reverse proxy. + * This method is only intended for the remote API clients who cannot resolve relative references + * (even this won't work for the same reason, which should be fixed.) + */ @Exported(visibility=2,name="url") public final String getAbsoluteUrl() { return project.getAbsoluteUrl()+getNumber()+'/'; diff --git a/core/src/main/resources/hudson/tasks/test/AbstractTestResultAction/summary.jelly b/core/src/main/resources/hudson/tasks/test/AbstractTestResultAction/summary.jelly index acc11135e2..1132f402f2 100644 --- a/core/src/main/resources/hudson/tasks/test/AbstractTestResultAction/summary.jelly +++ b/core/src/main/resources/hudson/tasks/test/AbstractTestResultAction/summary.jelly @@ -38,7 +38,7 @@
  • - + ${testObject.fullName}
  • diff --git a/core/src/main/resources/hudson/tasks/test/MatrixTestResult/index.jelly b/core/src/main/resources/hudson/tasks/test/MatrixTestResult/index.jelly index d26fac6c69..9b637063e2 100644 --- a/core/src/main/resources/hudson/tasks/test/MatrixTestResult/index.jelly +++ b/core/src/main/resources/hudson/tasks/test/MatrixTestResult/index.jelly @@ -17,7 +17,7 @@ - ${report.child.project.name} + ${report.child.project.name} ${report.result.durationString} @@ -49,7 +49,7 @@

    - ${report.child.project.name} + ${report.child.project.name}

    @@ -61,7 +61,7 @@ -- GitLab
    - +