Uploaded image for project: 'Wicket'
  1. Wicket
  2. WICKET-612

HeaderContributor forces relative URL

Attach filesAttach ScreenshotVotersWatch issueWatchersCreate sub-taskLinkCloneUpdate Comment AuthorReplace String in CommentUpdate Comment VisibilityDelete Comments
    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Minor
    • Resolution: Fixed
    • 1.3.0-beta1
    • 1.3.0-beta2
    • wicket
    • None

    Description

      I consider this a bug, and was wondering if you do as well... If so, I will open a JIRA and attach a patch for it. Just let me know.

      In my 1.2.6 app, I have the following line:
      add(HeaderContributor.forCss("/resources/styles/global.css"));

      which generates this in the markup (correctly):
      <link rel ="stylesheet" type="text/css" href="/resources/css/global.css" ></link>

      In 1.3, it generates this in the markup (incorrectly):
      <link rel ="stylesheet" type="text/css" href="../../..//resources/styles/global.css" ></link>

      This is because of the change to have everything with relative URLs, I am assuming. But, I don't want a relative URL, I want an absolute one. I'm thinking that the following change would be appropriate:

      HeaderContributor.java (26)
      if (location.startsWith("http://") || location.startsWith("https://"))

      changed to:

      if (location.startsWith("http://") || location.startsWith("https://") || location.startsWith("/"))

      Attachments

        Activity

          This comment will be Viewable by All Users Viewable by All Users
          Cancel

          People

            almaw Alastair Maw
            jthomerson Jeremy Thomerson
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Slack

                Issue deployment