Project

General

Profile

Bug #495

closed

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

Added by Anonymous over 14 years ago. Updated about 12 years ago.

Status:
Fixed
Priority:
Normal
Category:
core
Target version:
-
ASK QUESTIONS IN Forums:

Description

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.

-- lorinel

#1

Updated by jan over 14 years ago

cosmetic cleanups

#2

Updated by darix over 14 years ago

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

#3

Updated by moo over 14 years ago

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.

#4

Updated by jan about 13 years ago

  • Status changed from New to Assigned

can you try if this is fixed in 1.4.17 ?

#5

Updated by Anonymous about 13 years ago

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

#6

Updated by stbuehler over 12 years ago

  • Status changed from Assigned to Fixed
  • Resolution set to fixed

Fixed in r2080, see #1164

Also available in: Atom