Re: [Zope] redirect strangeness ...
From myzope@gmx.net Tue Aug 27 08:04:55 2002 Date: Tue, 27 Aug 2002 17:02:54 +0200 From: Oliver Bleutgen <myzope@gmx.net> User-Agent: Mozilla/5.0 (Windows; U; WinNT4.0; en-US; rv:1.0.0) Gecko/20020530 X-Accept-Language: en-us, en MIME-Version: 1.0 To: Dennis Allison <allison@sumeru.stanford.EDU> CC: zope@zope.org Subject: Re: [Zope] redirect strangeness ... References: <200208271409.HAA31207@sumeru.stanford.EDU> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit
Dennis Allison wrote:
Thanks for digging it out, Oliver. When I get a moment, I'll look at the Zope code and see if it requires an absolute_url for redirection to an internal URI.
Oliver Bleutgen <myzope@gmx.net> wrot:
it's _not_ about zope needing this. It's about the browser. Zope sends a 302 http-status code and a http-header which looks in your case like this:
Location: index_html
Now you have to rely on the browser to make sense of that location. Again, this is in no way something which zope imposes.
I would have thought that Zope would have intercepted the redirect and processed it locally it it could (why do a server-client-server transaction if you don't have to). Even if there were a browser transaction, wouldn't the browser simply note that the URL is local and make a request using the current base. Zope then would have to sort out the proper target URL. The fact that it works most of the time seems to support this view although I have not looked in detail at the code nor at the behavior of the various browsers.
Dennis Allison wrote:
I would have thought that Zope would have intercepted the redirect and processed it locally it it could (why do a server-client-server transaction if you don't have to).
No, zope doesn't do this. And it would be very wrong if it did. If you want to "process it locally", just don't send a redirect, call the method you want to send yourself on the server, instead of calling a RESPONSE.redirect().
Even if there were a browser transaction,
Believe me, it is. Did you try tcpwatch?
wouldn't the browser simply note that the URL is local and make a request using the current base. Zope then would have to sort out the proper target URL.
Most browser do it, but it is not guaranted to work by the standard. I already told how I was bitten by a similar problem.
The fact that it works most of the time seems to support this view although I have not looked in detail at the code nor at the behavior of the various browsers.
I'm quite sure it works with most (all) modern browsers, but tacking the absolute_url to the redirect location doesn't hurt and is rfc-conform. So why not do it? cheers, oliver
participants (2)
-
Dennis Allison -
Oliver Bleutgen