Forum OpenACS Development: Re: rp_filter and host-node mapped subsites

Collapse
Posted by Ryan Gallimore on
rp_filter is the correct proc name - my mistake.

I was able to resolve the issue by converting ns_getform vars into a query request. This should take care of any POSTed files too.

This seems to work, but is there a better way to do it?


--- request-processor-procs.tcl 11 May 2010 23:38:17 -0000 1.102.2.1
+++ request-processor-procs.tcl 23 Jun 2011 13:03:52 -0000
@@ -536,11 +536,19 @@
set url [ad_conn url]
# 2. handle special case: if the root is a prefix of the URL,
# remove this prefix from the URL, and redirect.
+
if { $root ne "" } {
if { [regexp "^${root}(.*)$" $url match url] } {
-
- if { [regexp {^GET [^\?]*\?(.*) HTTP} [ns_conn request] match vars] } {
- append url ?$vars
+ if { [regexp {^(GET|POST) [^\?]*\??(.*) HTTP} [ns_conn request] match method vars] } {
+ if {$method eq "GET"} {
+ append url ?$vars
+ } else {
+ foreach {name value} [ns_set array [ns_getform]] {
+ append vars "[ad_urlencode $name]=[ad_urlencode $value]&"
+ }
+ set vars [string range $vars 0 end-1]]
+ append url ?$vars
+ }
}
if { [security::secure_conn_p] } {
# it's a secure connection.
@@ -548,6 +556,7 @@
-allow_complete_url https://[ad_host][ad_port]$url
return "filter_return"
} else {
ad_returnredirect \
-allow_complete_url http://[ad_host][ad_port]$url
return "filter_return"