3 Replies Latest reply on Aug 26, 2012 3:36 PM by Sham HC

    Referer question

    upasana.chaube

      I am trying to get the referer of a page using  :  referer = request.getHeader("Referer"); 

      This works fine.

      The only case it doesn't work is when I open a new page from the CRX repository inside "content/mypage". I am expecting a null referer in this case, but it defaults referer of my page as : http://localhost:4502/crx/../mypage.jsp

        • 1. Re: Referer question
          orotas Level 4

          That's the expected result right? You clicked on a link to get to the page so you get a referrer right. Setting the referrer value done by the browser, so anytime you click on a link you are going to get a referrer. Is there some reason that's a problem?

          • 2. Re: Referer question
            upasana.chaube Level 1

            Thanks for your reply. Perhaps I was not much descriptive.

            When I click on a link (on a page abc.html) to open my page (say mypage.html), referer is abc.html - which is as expected.

            But when I open mypage.html directly from the CRX repository by navigating inside /content/...path-to- .. mypage.html, the referer value defaults to the location of mypage.html inside CRX, instead of a null value - which is not what I am expecting.

            So is there any way I can set the referal to null value for this case?

            • 3. Re: Referer question
              Sham HC Level 7

              The Referer is always the document/resource that is referring to the current resource.  Since you are opening from content explorer the referal can't be null & will be  http://<host>:<port>/crx/explorer/browser/content.jsp