6 Replies Latest reply: Jan 12, 2009 2:05 AM by 807574 RSS

    can browser information be lost while passing gateway?

    807574
      Hi,
      I'm trying to get a web application running through the portal gateway. The webapp has different javascript files for IE vs Mozilla. So it checks the browser information and decides to pick the /ie/client.js or /moz/client.js. This checking occurs in the apps login page, like this:
      // Netscape
      if (browserApp == "Netscape") {
      //all NN7 browsers and above are Gecko based
      if (navigator.userAgent.indexOf("Gecko") != -1)
      browserOK = true;
      }
      // IE
      else if (browserApp == "Microsoft Internet Explorer") {
      var browserVersion = navigator.appVersion;
      var MSIEindex = browserVersion.indexOf('MSIE ');

      // Check for IE version 6.0 or higher
      if (MSIEindex >= 0) {
      var MSIEversion = browserVersion.substring(MSIEindex+5);
      var vf = parseFloat(MSIEversion);
      if (vf >= 6.0)
      browserOK = true;
      }
      }

      // Generate message if needed
      if (!browserOK) {
      if ("On" != "Off") {
      alert("You appear to be running a browser that is not supported by ...");
      }
      }

      Now, using IE it uses the correct file (/ie/client.js). Using Mozilla the app sends the wrong file (also /ie/client.js instead of /moz/client.js).

      I want it to work using Mozilla also (without changing the js code of course).

      Is it possible that because of the use of the gateway the right browser information is lost? Can someone help me with this?

      Greets,
      Timv
        • 1. Re: can browser information be lost while passing gateway?
          807574
          Could you set debug level to message and look into the Gateway_from_to_Server resp. Gateway_from_to_Browser debug log?
          The User-Agent header should be listed there.
          -Bernhard
          • 2. Re: can browser information be lost while passing gateway?
            807574
            thanks thalmayr.

            I see that it's listed. And it works too (for mozilla appName is Netscape and user agent is Gecko, so the above javascript works).

            I guess it is not a portal issue anymore. The application has folders /resources/ie/javascript and resources/moz/javascript. When you surf to .../resources/javascript (which is no folder in the tomcat webapp) using mozilla, it uses the resources/moz/javascript files. However when surfing through the portal using https://..gw../http://.../resources/javascript, I get the /resources/ie/javascript file, which is wrong.
            • 3. Re: can browser information be lost while passing gateway?
              807574
              When surfing to some javascript file you always get the source.
              It might be a matter of rewriting of the javascript.
              -Bernhard
              • 4. Re: can browser information be lost while passing gateway?
                807574
                Did anyone find the solution for this problem?

                I'm having the exact same problem.

                When surfing directly to the application, the Javascript file for the correct browser is being returned. When surfing through portal 6, the Mozilla-file is always returned.

                I've checked the Java Code of the Application, and it searches for the string 'Gecko' and 'MSIE' to return the correct file. If none of those is found, the IE file should be returned.

                When I launched a packet tracer on the application server, I noticed no differences in the HTTP requests, the User-Agent header was left unchanged.

                The weirdest thing is: this setup has always worked, but suddenly it stopped working, altough nothing was changed in the portal or in the application.

                The only thing that was changed are the proxy servers: could this be caused by a proxy server?


                Thanks in advance.
                Sten
                • 5. Re: can browser information be lost while passing gateway?
                  807574
                  I've found out that that javascript file has been cached. I don't know yet if it is cached by the Secure Remote Access server or by some kind of proxy server.

                  I've read in the docs that caching can be disabled, but it looks to me that it would disable ALL caching and not just caching for a certain URL. Is there a way for telling the gateway that it should not cache the contents retrieved from a certain URL (e.g: the file "http://myserver.com/app/js/foo.js" should never be cached).

                  Or is there another workaround (the HTTP request keeps adding the "If-Modified-Since" header, which causes a response of "304 Not Modified")?

                  Or should I be doing this on the webserver of the application: adding some kind of "Cache-Control: no-cache" header?

                  Thanks,
                  Sten
                  • 6. Re: can browser information be lost while passing gateway?
                    807574
                    Disabling the cache on the proxy servers managed the trick for me.

                    Regards,
                    Sten