Mark James wrote:
I'm having CGI redirect problems mp2 (cvs).

Instead of being redirected to the proper web page, I'm sometimes
getting a "302 Moved" page containing a link to the correct URL.

Seems to be related to the following code in modperl_cgi.c:

if (location && (location[0] == '/') && (r->status == 200)) {
        r->method = apr_pstrdup(r->pool, "GET");
        r->method_number = M_GET;


The Location field I'm redirecting to is a fully-qualified URL, starting with http://, but still at the local server. A debug put in above this code confirms that "location" is set to a string starting with "http".

Why is the test for "location[0] == '/'" there?  Which section
of code is usually responsible for stripping off the server
part of the address if it is local?

as the comment just above this line says, that code was copy-n-pasted from mod_cgi. Can you reproduce the same problem while running a cgi script?


Also could it be that it has to do with the recent change, I've applied which was already reported by Beau as broken. May be your headers don't get parsed What happens if you do:

Index: src/modules/perl/modperl_filter.c
===================================================================
RCS file: /home/cvs/modperl-2.0/src/modules/perl/modperl_filter.c,v
retrieving revision 1.54
diff -u -r1.54 modperl_filter.c
--- src/modules/perl/modperl_filter.c   3 Mar 2003 03:39:06 -0000       1.54
+++ src/modules/perl/modperl_filter.c   5 Mar 2003 23:15:44 -0000
@@ -55,7 +55,7 @@
     apr_bucket *bucket;
     const char *work_buf = buf;

-    if (wb->header_parse && !wb->r->content_type) {
+    if (wb->header_parse) {
         request_rec *r = wb->r;
         const char *bodytext = NULL;
         int status;



__________________________________________________________________
Stas Bekman            JAm_pH ------> Just Another mod_perl Hacker
http://stason.org/     mod_perl Guide ---> http://perl.apache.org
mailto:[EMAIL PROTECTED] http://use.perl.org http://apacheweek.com
http://modperlbook.org http://apache.org   http://ticketmaster.com



Reply via email to