unreadable output after internal redirect

unreadable output after internal redirect

am 20.08.2009 16:54:18 von Mark Copper

Hi,

I have a Mason dhandler that generates an HTML page containing a form.
The action of the form is to get the same page that is displayed. If the
URL contains a certain parameter, an internal redirect is issued:

URL: mydomain.com/information/dhandler/variable.html?modification =update

<%args>
$modification=>undef


....


....

....



....
if ($modification eq "update"){
my $location = "/data_update?session=$session&" . $r->args;
$r->internal_redirect($location);
return OK;
....


A Perl handler processes requests to /data_update and issues a new
internal redirect to a third page:


SetHandler perl-script
PerlHandler MyApp::DataUpdate
DefaultType text/html


The third page (usually) displays correctly but there is trouble
beneath. Following any link on the third page results in a display of
gibberish--binary data except for the HTTP header buried midway through.
This third page never causes any trouble except when approached through
this internal redirect.


I've probably left out all the information you need to know in order to
suggest a solution. So I guess that's my question; where do I need to
look more carefully?

Sorry if *this* page is gibberish. Thanks for reading.

Mark

Re: unreadable output after internal redirect

am 21.08.2009 08:47:56 von Fred Moyer

On Thu, Aug 20, 2009 at 7:54 AM, Mark Copper wr=
ote:
> Hi,
>
> I have a Mason dhandler that generates an HTML page containing a form.
> The action of the form is to get the same page that is displayed. =A0If t=
he
> URL contains a certain parameter, an internal redirect is issued:

Can you provide what versions of mod_perl, apache, and perl you are using?

Have you asked the Mason list also? Is there a reason why you aren't
using an external redirect here? Seems like you might want that
instead of the internal_redirect, since you are redirecting to a
different url.


>
> URL: mydomain.com/information/dhandler/variable.html?modification =3Dupdat=
e
>
> <%args>
> $modification=3D>undef
>
>
> ...
>


> ...
>
> ...
>

>
>
> ...
> if ($modification eq "update"){
> =A0 my $location =3D "/data_update?session=3D$session&" . $r->args;
> =A0 $r->internal_redirect($location);
> return OK;
> ...
>

>
> A Perl handler processes requests to /data_update and issues a new
> internal redirect to a third page:
>
>
> =A0 SetHandler perl-script
> =A0 PerlHandler MyApp::DataUpdate
> =A0 DefaultType text/html
>

>
> The third page (usually) displays correctly but there is trouble
> beneath. Following any link on the third page results in a display of
> gibberish--binary data except for the HTTP header buried midway through.
> This third page never causes any trouble except when approached through
> this internal redirect.
>
>
> I've probably left out all the information you need to know in order to
> suggest a solution. =A0So I guess that's my question; where do I need to
> look more carefully?
>
> Sorry if *this* page is gibberish. =A0Thanks for reading.
>
> Mark
>

Re: unreadable output after internal redirect

am 21.08.2009 18:08:49 von Mark Copper

On Thu, Aug 20, 2009 at 11:47:56PM -0700, Fred Moyer wrote:
> On Thu, Aug 20, 2009 at 7:54 AM, Mark Copper wrote:
> > Hi,
> >
> > I have a Mason dhandler that generates an HTML page containing a form.
> > The action of the form is to get the same page that is displayed. ?If the
> > URL contains a certain parameter, an internal redirect is issued:
>
> Can you provide what versions of mod_perl, apache, and perl you are using?

Server: Apache/2.2.9 (Debian) mod_ssl/2.2.9 OpenSSL/0.9.8g
mod_apreq2-20051231/2.6.0 mod_perl/2.0.4 Perl/v5.10.0

>
> Have you asked the Mason list also? Is there a reason why you aren't
> using an external redirect here? Seems like you might want that
> instead of the internal_redirect, since you are redirecting to a
> different url.

No, I didn't try the Mason list yet; it was just a stab in the dark that
the problem lay with the perl handler and redirects.

Although this server is not real busy, internal redirects have always
made a big improvement speedwise over external (something I learned from
the MP cookbook--many thanks to those guys).

Thank you for taking a look.

Mark
>
>
> >
> > URL: mydomain.com/information/dhandler/variable.html?modification =update
> >
> > <%args>
> > $modification=>undef
> >
> >
> > ...
> >


> > ...
> >
> > ...
> >

> >
> >
> > ...
> > if ($modification eq "update"){
> > ? my $location = "/data_update?session=$session&" . $r->args;
> > ? $r->internal_redirect($location);
> > return OK;
> > ...
> >

> >
> > A Perl handler processes requests to /data_update and issues a new
> > internal redirect to a third page:
> >
> >
> > ? SetHandler perl-script
> > ? PerlHandler MyApp::DataUpdate
> > ? DefaultType text/html
> >

> >
> > The third page (usually) displays correctly but there is trouble
> > beneath. Following any link on the third page results in a display of
> > gibberish--binary data except for the HTTP header buried midway through.
> > This third page never causes any trouble except when approached through
> > this internal redirect.
> >
> >
> > I've probably left out all the information you need to know in order to
> > suggest a solution. ?So I guess that's my question; where do I need to
> > look more carefully?
> >
> > Sorry if *this* page is gibberish. ?Thanks for reading.
> >
> > Mark
> >