You are viewing a plain text version of this content. The canonical link for it is here.
Posted to apache-bugdb@apache.org by Rob Lindenbusch <lf...@ai.org> on 1999/08/30 17:13:52 UTC

general/4928: Rewrites using proxy option [P] drop QUERY-STRING

>Number:         4928
>Category:       general
>Synopsis:       Rewrites using proxy option [P] drop QUERY-STRING
>Confidential:   no
>Severity:       critical
>Priority:       medium
>Responsible:    apache
>State:          open
>Class:          sw-bug
>Submitter-Id:   apache
>Arrival-Date:   Mon Aug 30 08:20:01 PDT 1999
>Last-Modified:
>Originator:     lfcrob@ai.org
>Organization:
apache
>Release:        1.3.9
>Environment:
SunOS bart 5.6 Generic_105181-15 sun4u sparc SUNW,Ultra-2 - current patches
gcc version egcs-2.91.66 19990314 (egcs-1.1.2 release)
>Description:
Using the following rewrite rule:
RewriteRule /web/servers/apache-bart/share/cgi-bin/foobar(.*)$ http://bart.ai.org/cgi-bin/rewrite$1 [P]

The form (rewrite.html):

<HTML>
<HEAD>
<TITLE>
Rewrite Bug Test
</TITLE>
</HEAD>
<BODY>
<FORM METHOD="GET" ACTION="/cgi-bin/foobar/print.perl">
<INPUT TYPE="TEXT" NAME="String">
<INPUT TYPE="SUBMIT">
</FORM>
</BODY>
</HTML>

And the script (/cgi-bin/rewrite/print.perl):

#! /usr/local/bin/perl

print "Content-type:  text/html\n\n";

if ($ENV{'REQUEST_METHOD'} eq "GET") {
  $in = $ENV{'QUERY_STRING'};
}
elsif ($ENV{'REQUEST_METHOD'} eq "POST") {
  for ($i = 0; $i < $ENV{'CONTENT_LENGTH'}; $i++) {
    $in .= getc;
  }
}
print "Method: $ENV{'REQUEST_METHOD'}<BR>\n";
print "In : $in<BR>\n";
print "QUERY-STRING : $ENV{'QUERY_STRING'}<BR>\n";
print "CONTENT_LENGTH : $ENV{'CONTENT_LENGTH'}<BR>\n";

Under 1.3.9 the QUERY-STRING is absent when the script is called through the
rewrite. Swapping out the 1.3.9 binary with 1.3.6 (no other changes) produces
the correct results. When the script is called directly under 1.3.9, it
functions correctly. There *may* also be a problem with the POST method. This
does not seem to be present in this example, but rewrites of some POST 
operations from Solaris Apache 1.3.9 to an ASP script running under IIS4 show
a similar loss of POST information. (Once again, behaviour is correct
under 1.3.6).

>How-To-Repeat:
See above scripts/html
>Fix:
I have tried replacing the 1.3.9 mod_rewrite and mod_proxy with the versions
from 1.3.6. The problem does not seem to go away, and it appears it may be
somewhere else.
>Audit-Trail:
>Unformatted:
[In order for any reply to be added to the PR database, you need]
[to include <ap...@Apache.Org> in the Cc line and make sure the]
[subject line starts with the report component and number, with ]
[or without any 'Re:' prefixes (such as "general/1098:" or      ]
["Re: general/1098:").  If the subject doesn't match this       ]
[pattern, your message will be misfiled and ignored.  The       ]
["apbugs" address is not added to the Cc line of messages from  ]
[the database automatically because of the potential for mail   ]
[loops.  If you do not include this Cc, your reply may be ig-   ]
[nored unless you are responding to an explicit request from a  ]
[developer.  Reply only with text; DO NOT SEND ATTACHMENTS!     ]