[ZCM] [ZC] 546/ 2 Comment "Form variable CONTENT_TYPE lost"

Collector: Zope Bugs, Features, and Patches ... zope-coders-admin@zope.org
Fri, 14 Feb 2003 03:20:54 -0500


Issue #546 Update (Comment) "Form variable CONTENT_TYPE lost"
 Status Pending, Zope/bug low
To followup, visit:
  http://collector.zope.org/Zope/546

==============================================================
= Comment - Entry #2 by leper on Feb 14, 2003 3:20 am

This is ZPublisher's doing, it does the same thing for every key mentioned in the isCGI_NAME function (see the top of lib/python/ZPublisher/HTTPRequest.py).  I'm guessing it may be done in a misguided attempt to protect people from pulling a variable out of the form namespace which they thought would be coming from the environment.  Its been like this since version 1.1 of HTTPRequest.py though, I sort of doubt it will ever change, despite that it is clearly silly.
________________________________________
= Request - Entry #1 by peterb on Aug 28, 2002 9:38 am

The following DTML document illustrates the problem:


 <dtml-var standard_html_header>
 <h2><dtml-var title_or_id></h2>

 &dtml.missing-CONTENT_TYPE;
 &dtml.missing-ref;

 <form>
   CONTENT_TYPE: <input type='text'  name='CONTENT_TYPE'>
   <p>
   ref:    <input type='text' name='ref'>
   <p>
   <input type='submit'>
 </form>

 <dtml-var "REQUEST.form">

 <dtml-var standard_html_footer>


The form vars of the request object doesn't include the value of the submitted CONTENT_TYPE field, it is lost somewhere. OTOH the REQUEST object itself contains the content type of the submitted form which may be accessed using REQUEST.CONTENT_TYPE but this is not the value of the form variable.

Running the above will show how any entered 'ref' is displayed above and below (after submission) whereas the 'CONTENT_TYPE' form variable never is.
==============================================================