Wrong server in URL (was: Re: [Zope] (no subject))

Michael Havard nhavar@hotmail.com
Mon, 17 Mar 2003 16:12:08 +0000


MORE INFO:

Okay we've dug a little deeper into it and are even more confused.

We have three frames TOOLBAR, NAVBAR, WORKSPACE. The content served from 
these frames comes off of a java appserver (servlets). When we click on a 
button in the toolbar it calls the workspace with a URL to a "controller" 
servlet, which parses the request and serves up/redirects to the appropriate 
page. In this instance we are making a request for a ZOPE document. The 
servlet is doing a redirect, we are getting a 302 temporarily moved and then 
recieving the ZOPE content.

The problem at this point is that all of the links within that page are now 
broken with incorrect host. Looking at some of the header information inside 
ZOPE I see that a normal (directly to ZOPE) request
has headers something like

URL0 http://host:8300/Site/index_html
URL1 http://host:8300/Site
URL2 http://host:8300
BASE0 http://host:8300
BASE1 http://host:8300
BASE2 http://host:8300/Site
BASE3 http://host:8300/Site/index_html

SERVER_PORT '8300'
PATH_TRANSLATED '/Site/index_html'
SERVER_NAME 'host'
HTTP_USER_AGENT 'Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 4.0)'
PATH_INFO '/Site/index_html'
HTTP_HOST 'host:8300'
REQUEST_METHOD 'GET'

and that's fine as it should be on a direct request. But on the redirect the 
information looks like this:

URL0 http://host:8200/Site/index_html
URL1 http://host:8200/Site
URL2 http://host:8200
BASE0 http://host:8200
BASE1 http://host:8200
BASE2 http://host:8200/Site
BASE3 http://host:8200/Site/index_html

SERVER_PORT '8300'
PATH_TRANSLATED '/Site/index_html'
SERVER_NAME 'host'
HTTP_USER_AGENT 'Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 4.0)'
PATH_INFO '/Site/index_html'
HTTP_HOST 'host:8200'
REQUEST_METHOD 'GET'

In that the SERVER_PORT and SERVER_NAME are correct matching the ZOPE server 
instance. The HTTP_HOST, URLs, and BASEs are incorrect though showing the 
requesting app servers port number.

I'm assuming that ZOPE uses BASE or URL or possibly even HTTP_HOST as the 
basis for building any URLS within the dynamically built pages.

>From: Dieter Maurer <dieter@handshake.de>
>To: "Michael Havard" <nhavar@hotmail.com>
>CC: zope@zope.org
>Subject: Wrong server in URL (was: Re: [Zope] (no subject))
>Date: Fri, 14 Mar 2003 23:04:24 +0100
>
>You should provide a useful subject....
>
>Michael Havard wrote at 2003-3-13 17:15 +0000:
>  > having a problem getting the absolute_url or portal_url within a CMF 
>site.
>  >
>  > We have a framed site that puts a ZOPE CMF site in one frame when 
>needed.
>  > When the frame is first loaded all the links point to "mysite:8200" 
>instead
>  > of where the ZOPE instance is being run "mysite:8300". If I right click 
>on
>  > the zope frame and reload I get the correct links but loading it from
>  > another frame breaks the link reference. Is there another way to get 
>the
>  > url?
>
>That's really strange, as the server does not know whether the
>request comes from a frame or not....
>
>Are you sure, it is not a caching problem?
>
>You recognize a (HTTP) caching problem by forcing a page
>reload ("reload" maybe with "shift" key pressed)
>and then everything is okay.
>
>
>Dieter
>
>_______________________________________________
>Zope maillist  -  Zope@zope.org
>http://mail.zope.org/mailman/listinfo/zope
>**   No cross posts or HTML encoding!  **
>(Related lists -
>  http://mail.zope.org/mailman/listinfo/zope-announce
>  http://mail.zope.org/mailman/listinfo/zope-dev )


_________________________________________________________________
STOP MORE SPAM with the new MSN 8 and get 2 months FREE*  
http://join.msn.com/?page=features/junkmail