- making Zope stop inserting a BASE HREF tag?
Hey there, I've got a Zope running under ZopeHTTPServer on an NT4 box - for some reason it keeps inserting a BASE href into the HTML it sends back. For various reasons, this box's name is not what it's really known as - it's proxied in wierd and wonderful ways. For example, the following DTML (from standard_html_header) <HTML><HEAD><TITLE> <!--#var title_or_id--> </TITLE></HEAD><BODY BGCOLOR="#FFFFFF"> gives this: <HTML><HEAD><TITLE>Zope</TITLE> <base href="http://TSWITCH:9673/"> </HEAD><BODY BGCOLOR="#FFFFFF"> It looks like some code in ZPublisher/Response.py is responsible - is there an easy way to fix this, short of taking an adze to that section of code? I don't _really_ want to hardcode a base - just to let the HTML go straight through, and let the browser figure it out itself. Thanks, Anthony -- Anthony Baxter, NextTelecom. email:anthony@interlink.com.au, voice: +61 416 271 170
On Mon, 18 Jan 1999, Anthony Baxter wrote:
Hey there,
I've got a Zope running under ZopeHTTPServer on an NT4 box - for some reason it keeps inserting a BASE href into the HTML it sends back. For various reasons, this box's name is not what it's really known as - it's proxied in wierd and wonderful ways.
I guess this is my problem too, mentioned in an earlier post about authorization... (I have to repeat my password 3 times because I have two proxies). Would solving this remove the need for repeating my password, or are there other places where absolute URLs creep into the response? (I guess I might still have to repeat it twice... Hm...) -- Magnus Lie Hetland www.pvv.org/arcadia <arcadia@pvv.org>
On Mon, 18 Jan 1999, Magnus Lie Hetland wrote:
I guess this is my problem too, mentioned in an earlier post about authorization... (I have to repeat my password 3 times because I have two proxies). Would solving this remove the need for repeating my password, or are there other places where absolute URLs creep into the response? (I guess I might still have to repeat it twice... Hm...) Not automatically by ways of Bobo, but Bobo needs to know the URI of the module to calculate BASE and URL variables. So removing the BASE tag is not the solution.
Andreas -- Win95: n., A huge annoying boot virus that causes random spontaneous system crashes, usually just before saving a massive project. Easily cured by UNIX. See also MS-DOS, IBM-DOS, DR-DOS, Win 3.x, Win98.
Anthony Baxter wrote:
Hey there,
I've got a Zope running under ZopeHTTPServer on an NT4 box - for some reason it keeps inserting a BASE href into the HTML it sends back. For various reasons, this box's name is not what it's really known as - it's proxied in wierd and wonderful ways.
For example, the following DTML (from standard_html_header) <HTML><HEAD><TITLE> <!--#var title_or_id--> </TITLE></HEAD><BODY BGCOLOR="#FFFFFF">
gives this:
<HTML><HEAD><TITLE>Zope</TITLE> <base href="http://TSWITCH:9673/"> </HEAD><BODY BGCOLOR="#FFFFFF">
It looks like some code in ZPublisher/Response.py is responsible - is there an easy way to fix this, short of taking an adze to that section of code? I don't _really_ want to hardcode a base - just to let the HTML go straight through, and let the browser figure it out itself.
There are many cases where the browser *can't* figure it out itself. Consider accessing a folder F that has an index_html: http://www.spam.org/X/F Now the browser will interpret relative references as relative to X. But you are *really* accessing: X/F/index_html and relative references should be relative to: F. Similar things happen when you use HTTP methods other that GET and POST, and when you use the :method form variable feature. In fact, ZPublisher *only* sets the base href if it modifies the URL. In cases like this, the browser can't get relative references right by itself. I think that the right way to approach this problem is to get ZPublisher more involved in the proxying process so that it can compute the base href properly. Jim -- Jim Fulton mailto:jim@digicool.com Technical Director (888) 344-4332 Python Powered! Digital Creations http://www.digicool.com http://www.python.org Under US Code Title 47, Sec.227(b)(1)(C), Sec.227(a)(2)(B) This email address may not be added to any commercial mail list with out my permission. Violation of my privacy with advertising or SPAM will result in a suit for a MINIMUM of $500 damages/incident, $1500 for repeats.
participants (4)
-
Andreas Kostyrka -
Anthony Baxter -
Jim Fulton -
Magnus Lie Hetland