Uploaded image for project: 'Maven Shared Components'
  1. Maven Shared Components
  2. MSHARED-608

Remove index.html-adding block in AbstractMavenReportRenderer#getValidHref()

    Details

      Description

      If URL validation fails, the following is executed:

      String hrefTmp;
      if ( !href.endsWith( "/" ) )
      {
        hrefTmp = href + "/index.html";
      }
      else
      {
        hrefTmp = href + "index.html";
      }
      
      if ( UrlValidationUtil.isValidUrl( hrefTmp ) )
      {
        return href;
      }
      

      There are several problems here:

      • The assumption that / will point to index.html is wrong. This is not known. It can ultimately lead to 404. No assumption shall be made to the target.
      • There is no way that if a URL is already invalid it will get a valid URL by adding index.html.

      Remove this code block.

        Activity

        Hide
        michael-o Michael Osipov added a comment -

        Fixed with r1777793.

        Show
        michael-o Michael Osipov added a comment - Fixed with r1777793 .
        Hide
        hudson Hudson added a comment -

        SUCCESS: Integrated in Jenkins build maven-shared Jigsaw #675 (See https://builds.apache.org/job/maven-shared%20Jigsaw/675/)
        MSHARED-608 Remove index.html-adding block in AbstractMavenReportRenderer#getValidHref() (michaelo: http://svn.apache.org/viewvc/?view=rev&rev=1777793)

        • (edit) maven-reporting-impl/src/main/java/org/apache/maven/reporting/AbstractMavenReportRenderer.java
        Show
        hudson Hudson added a comment - SUCCESS: Integrated in Jenkins build maven-shared Jigsaw #675 (See https://builds.apache.org/job/maven-shared%20Jigsaw/675/ ) MSHARED-608 Remove index.html-adding block in AbstractMavenReportRenderer#getValidHref() (michaelo: http://svn.apache.org/viewvc/?view=rev&rev=1777793 ) (edit) maven-reporting-impl/src/main/java/org/apache/maven/reporting/AbstractMavenReportRenderer.java
        Hide
        hudson Hudson added a comment -

        SUCCESS: Integrated in Jenkins build maven-shared #3334 (See https://builds.apache.org/job/maven-shared/3334/)
        MSHARED-608 Remove index.html-adding block in AbstractMavenReportRenderer#getValidHref() (michaelo: http://svn.apache.org/viewvc/?view=rev&rev=1777793)

        • (edit) maven-reporting-impl/src/main/java/org/apache/maven/reporting/AbstractMavenReportRenderer.java
        Show
        hudson Hudson added a comment - SUCCESS: Integrated in Jenkins build maven-shared #3334 (See https://builds.apache.org/job/maven-shared/3334/ ) MSHARED-608 Remove index.html-adding block in AbstractMavenReportRenderer#getValidHref() (michaelo: http://svn.apache.org/viewvc/?view=rev&rev=1777793 ) (edit) maven-reporting-impl/src/main/java/org/apache/maven/reporting/AbstractMavenReportRenderer.java

          People

          • Assignee:
            michael-o Michael Osipov
            Reporter:
            michael-o Michael Osipov
          • Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development