Uploaded image for project: 'Sling'
  1. Sling
  2. SLING-2251

RedirectServlet should create relative Location headers as often as possible

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Closed
    • Major
    • Resolution: Fixed
    • Servlets Get 2.1.2
    • Servlets Get 2.1.4
    • Servlets
    • None

    Description

      SLING-1965 (more specifically http://svn.apache.org/viewvc?view=revision&revision=903175 ) changed the redirect servlet so that it always generates an absolute location header. The issue does not give much reasoning for that.

      The problem is that this breaks cases where a Sling server is run behind a proxy (which does not or cannot rewrite the Location header), as the redirect ("http://localhost:8080/some/path") might not match the externally visible domain (e.g. "https://my.domain.com"). Also, the schema is fixed (e.g. might switch external https back to http).

      A solution would be to generate absolute URLs only if a resource resolver mapping (/etc/map) includes an explicit domain and thus generates an absolute URL. For all other cases, relative URLs should be generated. AFAICS, this was the case before SLING-1965.

      Attachments

        1. SLING-2251.patch
          1 kB
          Alexander Klimetschek
        2. SLING-2251-VanityPathTest.patch
          2 kB
          Troy Caldwell

        Issue Links

          Activity

            People

              fmeschbe Felix Meschberger
              alexander.klimetschek Alexander Klimetschek
              Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: