[Product-Developers] Re: Plone(?) Zope(?) Python(?) HTTP(?) security question

Derek Broughton derek at pointerstop.ca
Sun Jun 14 22:50:30 UTC 2009

Andreas Jung wrote:

> On 14.06.09 18:56, Ken Winter wrote:
>> I'm not sure whether this question is about Plone, or Zope, or Python, or
>> maybe even HTTP.  I thought I would start here.  If this isn't the place
>> to ask this question, please point me down the technology stack to the
>> right place.
>> I have written a Plone tool.  The tool has a public method called
>> submitRequest().  submitRequest() submits an HTTP request by calling the
>> httplib2 Http.request() method.  That method returns the HTTP response to
>> submitRequest() as a Python dict.  My tool's submitRequest() method
>> simply returns that dict.
>> I have written a Python script, rdb_callback.py, that calls
>> submitRequest().
>> The call works fine.  It returns the response dict.  The script can print
>> the response dict's contents to event.log just fine - the printout looks
>> like this:
>> 2009-06-14T10:57:33 INFO rdb_callback.py: response = {'status': '200',
>> 'content-length': '10', 'x-amz-id-2':
>> 'HILeDlwdldggdQYkR7a3q7qUC5DoZvMeM1Kp3pK9h7Nf/aB1qCQwGbGnIeSeWeTX',
>> 'x-cnection': 'close', 'server': 'AmazonS3', 'last-modified': 'Sun, 14
>> Jun 2009 15:57:33 GMT', 'x-amz-request-id': 'E28DD76138E8F97A', 'etag':
>> '"bab71c0770e5cafdfa00dfb26b4d94bb"', 'date': 'Sun, 14 Jun 2009 15:57:33
>> GMT', 'content-type': 'text/plain'}
> Are you sure that you see is *really* a dict - take the debugger and
> figure that
> out. Nothing everything looking like a dict has to be a dict.

Good guess, imo.  I had something like this in some of my code.  I don't 
think it was an HTTP request, but I remember commenting my code with "coerce 
result to a dict, because whatever I'm getting isn't _really_ a dict".  So I 
was just returning "return dict(result)".

More information about the Product-Developers mailing list