[Zope] Does Zope translate http-equiv statements?

Richard Barrett R.Barrett@ftel.co.uk
Thu, 14 Feb 2002 18:51:10 +0000


Just to add my 2 pennyworth to the discussion: looking at the following URL 
http://www.w3.org/TR/REC-html40/struct/global.html#edef-META#edef-META, it 
says:

<quote>
META and HTTP headers
The http-equiv attribute can be used in place of the name attribute and has 
a special significance when documents are retrieved via the Hypertext 
Transfer Protocol (HTTP). HTTP servers may use the property name specified 
by the http-equiv attribute to create an [RFC822]-style header in the HTTP 
response. Please see the HTTP specification ([RFC2616]) for details on 
valid HTTP headers.
...
</quote>

My copy of the HTML 4 language spec says:

<quote>
The HTTP-EQUIV attribute may be used in place of the NAME attribute to 
indicate that the property is an HTTP header. Some servers will send the 
HTTP header specified in the META element, and browsers often recognize the 
header even when it is not sent by the server. Examples:
...
</quote>

So it would appear that Zope could care about <META http-equiv ...> tags in 
outgoing html documents and could automatically use them to place 
additional lines into the HTTP response headers. And that browsers may 
respond to <META http-equiv ...> tags as though the server had used them to 
add to the HTTP response headers even if it didn't.

On a quick search of the zope source code I couldn't find any code that 
seemed to be looking for <META http-equiv ...> in the prospective outgoing 
message and transmitting extra headers. From a coding standpoint it would 
be  pain in the neck having to read ahead but not yet send the outgoing 
HTML in order to capture and then transmit the extra HTTP response headers, 
and only when the closing </HEAD> tag has been read back up and start 
sending the content.

I suspect that using RESPONSE.setHeader to explicitly add HTTP response 
headers is probably the wisest and most reliable course if you really want 
the browser to receive and react to a legitimate HTTP header.

Don't you just love standards :)

At 09:37 14/02/2002 -0800, Chris Beaumont wrote:
>Andreas and Lennart,
>
>
>Excuse me if perhaps I'm misunderstanding you and you already know this.. 
>but..
>
>"The part between <HEAD> and </HEAD>" isn't the same as what most people 
>mean when they refer to the "header" actually..
>
>  The 'header' of an HTML document is rarely seen, unless you can sit and 
> watch the streamed exchange of data between the client and server 
> directly.. (using special tools, - sometimes this is *quite* useful in 
> debugging an interaction..)
>
>   It's in the "real" (almost always unseen) header that the client makes 
> the "GET" statement and it's also where the exchange that determines 
> mime-types happens.. It's also where you might get commands such as a 
> redirect or a 404 not found..(or other response codes..)
>
><dtml-call "RESPONSE.setHeader ...  DOES effect the stuff that happens in 
>the "real" header, and that's why it's such a useful command..
>
>The stuff in the HEAD can frequently be ignored if it contradicts 
>something in the real header.. This is the thing that varies by browser..
>
>Take a look at the HTTP specification.. it's all in there, and more..
>
>
>Hope that helps!
>
>Chris Beaumont
>
>
>
>>----- Original Message -----
>>From: "Lennart Regebro" <lennart@regebro.nu>
>>To: "Andreas Jung" <andreas@zope.com>; <zope@zope.org>
>>Sent: Thursday, February 14, 2002 11:12
>>Subject: Re: [Zope] Does Zope translate http-equiv statements?
>>
>>
>>>  From: "Andreas Jung" <andreas@zope.com>
>>>  > What is a HTML header ?
>>  > You know, the part between <HEAD> and </HEAD>... :-)
>>>
>>>  > I assume you mean meta-tags ?!
>>>
>>>  I do, yes.
>>>
>>>  > Zope does not care about http-equiv statements. Why should it ?
>>>
>>>  No reason at all, really. Some servers do and I'm trying to figure out
>>>  wether it is IE6 or the w3.org P3P validator that has a bug, and in that
>>>  case which bug it is. The P3P validator is happy with this statement:
>>>
>>>  <meta http-equiv="P3P" content="CP='CAO DSP COR LAW IND UNI COM NAV CURa
>>>  ADMa DEVa OUR'">
>>>
>>>  IE6 does not like it, but they both like:
>>  > <dtml-call "RESPONSE.setHeader('P3P','CP=' + _.chr(34) + 'CAO DSP COR LAW
>>>  IND UNI COM NAV CURa ADMa DEVa OUR' + _.chr(34) )">
>>>
>>>  Now, as you see, there are two differences here. One is an http-equiv, and
>>>  the other is that the single and double quotes are switched.
>>
>>HTTP-equiv is only for the web client. In your case I would slap the guys
>>from M$ for yet-another-non-compliant-implementation.
>>
>>Cheers,
>>Andreas
>
>_______________________________________________
>Zope maillist  -  Zope@zope.org
>http://lists.zope.org/mailman/listinfo/zope
>**   No cross posts or HTML encoding!  **
>(Related lists - http://lists.zope.org/mailman/listinfo/zope-announce
>http://lists.zope.org/mailman/listinfo/zope-dev )