Ticket #495 (closed defect: fixed)

Opened 2 years ago

Last modified 4 months ago

can't use $HTTP["remoteip"] inside $HTTP["url"]

Reported by: lorinel@gmail.com Assigned to: jan
Priority: normal Milestone:
Component: core Version: 1.4.9
Severity: normal Keywords:
Cc: Blocking:
Need Feedback: 1

Description (Last modified by jan)

The following works :

  $HTTP["url"] =~ "^/some_path($|/)" {
    ....
  }

while the following does not:

$HTTP["url"] =~ "^/some_path($|/)" {
  $HTTP["remoteip"] != "10.10.0.0/24" {
    ....
  }
}

in fact, having the remoteip part inside the url part prevents anything else in the url part from working... ex

$HTTP["url"] =~ "^/some_path($|/)" {
  dir-listing.activate = "disable"
  $HTTP["remoteip"] != "10.10.0.0/24" {
    ...
  }
}

the dir-listing.activate will not be used at all. If you remove the remote ip part:

$HTTP["url"] =~ "^/some_path($|/)" {
  dir-listing.activate = "disable"
}

it works as expected.

Attachments

Change History

02/08/2006 01:12:29 PM changed by jan

  • description changed.

cosmetic cleanups

02/12/2006 10:32:18 PM changed by darix

this is a general problem. stacked conditionals are not work at all atm.

03/27/2006 06:14:10 AM changed by moo

it's a known problem that $HTTPurl? cannot contains conditions other than another $HTTPurl?. workarround:

$HTTP["remoteip"] != "10.10.0.0/24" {
  ...
  $HTTP["url"] =~ "^/some_path($|/)" {
    dir-listing.activate = "disable"
  }
}
else $HTTP["remoteip"] == "10.10.0.0/24" {
  ...
  $HTTP["url"] =~ "^/some_path($|/)" {
  }
}

to avoid duplicating $HTTPurl? =~ "/some_path($|/)", u can put it into a file and include it.

09/02/2007 11:15:05 PM changed by jan

  • status changed from new to assigned.
  • blocking changed.
  • pending set to 1.

can you try if this is fixed in 1.4.17 ?

09/04/2007 10:12:12 PM changed by anonymous

The same issue as in #1164 - works in 1.4.17 with patch.

03/01/2008 11:42:18 AM changed by stbuehler

  • status changed from assigned to closed.
  • resolution set to fixed.

Fixed in [2080], see #1164


Add/Change #495 (can't use $HTTP["remoteip"] inside $HTTP["url"])




Change Properties
Action