https://bz.apache.org/bugzilla/show_bug.cgi?id=65956

            Bug ID: 65956
           Summary: SetEnvIfExpr inconsistent from request to request
           Product: Apache httpd-2
           Version: 2.4.6
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: normal
          Priority: P2
         Component: mod_setenvif
          Assignee: bugs@httpd.apache.org
          Reporter: mkp...@gmail.com
  Target Milestone: ---

I am using httpd-2.4.6-97.el7.centos.4.x86_64 (the latest distro package for
CentOS 7). I don't know if this has been fixed in a newer version.

I have been using SetEnvIfExpr to try to guess if browsers support my https
configuration based on User-Agent. (I found this when I decided to switch to
automatically redirecting to https unless one of these browsers was found, but
verified it exists with the old version too.)

The specific configuration that seems to be problematic (that I tested) is
this:

> # SetEnv doesn't work with RewriteCond below, so SetEnvIfExpr instead
> #SetEnv TLS 1
> SetEnvIfExpr "%{HTTPS} != 'on'" TLS=1
…
> # Firefox < 31
> SetEnvIfExpr "%{HTTP_USER_AGENT} =~ m#Firefox/([0-9+])# && $1 -lt 31" !TLS

If I request the same page multiple times with my User-Agent set to Firefox/40,
TLS only set about 50% of the time. Somehow it thinks 40 is less than 31?

Am I doing something wrong here?

-- 
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: bugs-unsubscr...@httpd.apache.org
For additional commands, e-mail: bugs-h...@httpd.apache.org

Reply via email to