Redirect in webrick with eruby

I am trying to do a redirect inside an erb page running under webrick.

I was able to do a redirect like this:
s.mount_proc("/redirect") { |request, response|
response.set_redirect(WEBrick::HTTPStatus::MovedPermanently,
"/")
}

However when I try to put the same code inside an erb page I get a
internal server error.
Any suggestions?

Michael Hale - Software Developer
RoleModel Software Inc. - The XP Software Studio
www.rolemodelsoftware.com

In message 002c01c290b2$f6c80fc0$2a01a8c0@MICHAELS8200,

···

`“Michael Hale” mhale@rolemodelsoft.com’ wrote:

I was able to do a redirect like this:
s.mount_proc(“/redirect”) { |request, response|
response.set_redirect(WEBrick::HTTPStatus::MovedPermanently,
“/”)
}

However when I try to put the same code inside an erb page I get a
internal server error.
Any suggestions?

Sorry, it’s a bug of WEBrick. The patch is here:

http://www.notwork.org/ipr/cgi-bin/cvsweb.cgi/src/webrick/lib/webrick/httpservlet/erbhandler.rb?cvsroot=ipr&r1=1.20&r2=1.21


gotoyuzo