You are viewing a plain text version of this content. The canonical link for it is here.
Posted to embperl@perl.apache.org by Neil Gunton <ne...@nilspace.com> on 2000/12/12 18:12:46 UTC

Possible bugs in EmbperlObject: 1.3b7, Apache 1.3.12, mod_perl 1.24

I think there may be a bug or two in the code which handles the case
where a non-existent file is requested by a browser, e.g.
http://www.mysite.com/xxxx.html, when EmbperlObject is being used.

I have EMBPERL_OBJECT_BASE set to base.html, which in turn does Execute
(*). The documentation says that if the specified file is not found and
EMBPERL_OBJECT_FALLBACK is not defined, then a 404 is returned as
normal. However I just get an "internal server error" message, not a
404. I set ErrorDocument 404 in httpd.conf, which would normally catch
any 404 (and actually does, if a filetype other than that handled by
Embperl is requested), but this situation appears to mean that a 404 is
never generated, so the httpd setting never kicks in. 

I can set EMBPERL_OBJECT_FALLBACK and catch the error, but this appears
to have its own problem: If I set EMBPERL_OBJECT_FALLBACK to be
subdir/notfound.html, then notfound.html should (I think) be executed
like other files which are normally included by base.html. However, this
doesn't appear to happen. For example, base.html does
Execute('init.html'). I redefine init.html in most subdirectories.
However when a non-existent document is requested and
EMBPERL_OBJECT_FALLBACK kicks in, and we are redirected to
subdir/notfound.html, then subdir/init.html is not executed.

Does this make any sense? If it's not clear then I can supply a more
rigorous example.

TIA

-Neil

Re: Possible bugs in EmbperlObject: 1.3b7, Apache 1.3.12, mod_perl 1.24

Posted by Gerald Richter <ri...@ecos.de>.
> > Mmm, strange, does it change anything if you replace the
> > 
> > return &NOT_FOUND ;
> > 
> > with
> > 
> > return 404 ;
> > 
> > in line 289 of EmbperlObject.pm ?
> 
> 
> No, same behavior. I assume that what I needed to do here was change the
> line, and then just do the whole make-install process again, and restart
> the webserver.
> 

Yes, that's right. I look soon into this...

Gerald



-------------------------------------------------------------
Gerald Richter    ecos electronic communication services gmbh
Internetconnect * Webserver/-design/-datenbanken * Consulting

Post:       Tulpenstrasse 5         D-55276 Dienheim b. Mainz
E-Mail:     richter@ecos.de         Voice:    +49 6133 925151
WWW:        http://www.ecos.de      Fax:      +49 6133 925152
-------------------------------------------------------------




Re: Possible bugs in EmbperlObject: 1.3b7, Apache 1.3.12, mod_perl 1.24

Posted by Neil Gunton <ne...@nilspace.com>.
Gerald Richter wrote:
> 
> > I have EMBPERL_OBJECT_BASE set to base.html, which in turn does Execute
> > (*). The documentation says that if the specified file is not found and
> > EMBPERL_OBJECT_FALLBACK is not defined, then a 404 is returned as
> > normal. However I just get an "internal server error" message, not a
> > 404. I set ErrorDocument 404 in httpd.conf, which would normally catch
> > any 404 (and actually does, if a filetype other than that handled by
> > Embperl is requested), but this situation appears to mean that a 404 is
> > never generated, so the httpd setting never kicks in.
> >
> 
> Mmm, strange, does it change anything if you replace the
> 
> return &NOT_FOUND ;
> 
> with
> 
> return 404 ;
> 
> in line 289 of EmbperlObject.pm ?


No, same behavior. I assume that what I needed to do here was change the
line, and then just do the whole make-install process again, and restart
the webserver.


> I would gues init.html (is executed, without subdir/).
> If you define notfound.html as EMBPERL_OBJECT_FALLBACK then it would be
> taken from the same directories as the normal file, i.e. walking up the
> directory tree until the dir where base.html lives, but when you specify
> subdir/notfound.html, subdir will _not_ included in this search. I think
> that's what you are seeing at the moment. That's not a bug, it's by design.

You're right, the base version of init.html is executed.

Ok, I can workaround this by having EMBPERL_OBJECT_FALLBACK set to just
"notfound.html", which will obviously be in the same directory as
base.html (i.e. the website root dir). All /notfound.html does now is
redirect to the real page, in subdir /errors/. Because that involves a
whole new call to the server, the correct version of init.html is called
this time. 

I thought it might be more intuitive to have the search start again from
whatever directory the EMBPERL_OBJECT_FALLBACK file was in, but I can
see how that might complicate things. The redirect works fine and so
it's probably not worth all the extra work.

However, we still have the fact that 404 is not generated by
EmbperlObject if we don't have the EMBPERL_OBJECT_FALLBACK.

Thanks for all your help!

-Neil

Re: Possible bugs in EmbperlObject: 1.3b7, Apache 1.3.12, mod_perl 1.24

Posted by Gerald Richter <ri...@ecos.de>.
> I have EMBPERL_OBJECT_BASE set to base.html, which in turn does Execute
> (*). The documentation says that if the specified file is not found and
> EMBPERL_OBJECT_FALLBACK is not defined, then a 404 is returned as
> normal. However I just get an "internal server error" message, not a
> 404. I set ErrorDocument 404 in httpd.conf, which would normally catch
> any 404 (and actually does, if a filetype other than that handled by
> Embperl is requested), but this situation appears to mean that a 404 is
> never generated, so the httpd setting never kicks in.
>

Mmm, strange, does it change anything if you replace the

return &NOT_FOUND ;

with

return 404 ;

in line 289 of EmbperlObject.pm ?

> I can set EMBPERL_OBJECT_FALLBACK and catch the error, but this appears
> to have its own problem: If I set EMBPERL_OBJECT_FALLBACK to be
> subdir/notfound.html, then notfound.html should (I think) be executed
> like other files which are normally included by base.html. However, this
> doesn't appear to happen. For example, base.html does
> Execute('init.html'). I redefine init.html in most subdirectories.
> However when a non-existent document is requested and
> EMBPERL_OBJECT_FALLBACK kicks in, and we are redirected to
> subdir/notfound.html, then subdir/init.html is not executed.
>

I would gues init.html (is executed, without subdir/).
If you define notfound.html as EMBPERL_OBJECT_FALLBACK then it would be
taken from the same directories as the normal file, i.e. walking up the
directory tree until the dir where base.html lives, but when you specify
subdir/notfound.html, subdir will _not_ included in this search. I think
that's what you are seeing at the moment. That's not a bug, it's by design.

Gerald


-------------------------------------------------------------
Gerald Richter    ecos electronic communication services gmbh
Internetconnect * Webserver/-design/-datenbanken * Consulting

Post:       Tulpenstrasse 5         D-55276 Dienheim b. Mainz
E-Mail:     richter@ecos.de         Voice:    +49 6133 925151
WWW:        http://www.ecos.de      Fax:      +49 6133 925152
-------------------------------------------------------------