Changeset 51242
- Timestamp:
- 02/23/07 14:32:36 (3 years ago)
- Files:
-
- funkload/trunk/CHANGES.txt (modified) (2 diffs)
- funkload/trunk/funkload/PatchWebunit.py (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
funkload/trunk/CHANGES.txt
r51240 r51242 48 48 ~~~~~~~~~ 49 49 50 * fix: report with percentiles are buggy sometime P10 value is greater than MED 50 * fix: # 1279_: Browser form submit encoding, default encoding for post is 51 now application/x-www-form-urlencoded, multipart mime encoding is used 52 only when uploading files. 53 54 * fix: report with percentiles are buggy sometime P10 value is greater 55 than MED. 51 56 52 57 * Patching webunit mimeEncode method to send CRLF as describe in RFC 1945 … … 434 439 .. _1201: http://svn.nuxeo.org/trac/pub/ticket/1201 435 440 .. _1278: http://svn.nuxeo.org/trac/pub/ticket/1278 441 .. _1279: http://svn.nuxeo.org/trac/pub/ticket/1279 436 442 .. _1282: http://svn.nuxeo.org/trac/pub/ticket/1282 437 443 .. _1283: http://svn.nuxeo.org/trac/pub/ticket/1283 funkload/trunk/funkload/PatchWebunit.py
r51240 r51242 26 26 * patching webunit mimeEncode to be rfc 1945 3.6.2 compliant using CRLF 27 27 * patching to remove cookie with a 'deleted' value 28 * patching to have application/x-www-form-urlencoded by default and only 29 multipart when a file is posted 28 30 29 31 $Id: PatchWebunit.py 24649 2005-08-29 14:20:19Z bdelbosc $ … … 33 35 import time 34 36 import urlparse 37 from urllib import urlencode 35 38 import httplib 36 39 import cStringIO … … 70 73 ret.write('\r\n') 71 74 ret.write(sep_boundary) 72 73 # if key starts with a '$' then the entry is a file upload74 75 if isinstance(value, Upload): 75 76 ret.write('\r\nContent-Disposition: form-data; name="%s"'%key) … … 251 252 params = None 252 253 if postdata: 254 if webproxy: 255 h.putrequest('POST', "http://%s%s" % (host_header, url)) 256 else: 257 # Normal post 258 h.putrequest('POST', url) 259 is_multipart = False 253 260 for field, value in postdata.items(): 254 261 if type(value) == type({}): 255 262 postdata[field] = [] 256 263 for k, selected in value.items(): 257 if selected: postdata[field].append(k) 258 259 # Do a post with the data file 260 params = mimeEncode(postdata) 261 if webproxy: 262 h.putrequest('POST', "http://%s%s" % (host_header, url)) 263 else: 264 # Normal post 265 h.putrequest('POST', url) 266 h.putheader('Content-type', 'multipart/form-data; boundary=%s'% 267 BOUNDARY) 264 if selected: 265 postdata[field].append(k) 266 if isinstance(value, Upload): 267 # Post with a data file requires multipart mimeencode 268 is_multipart = True 269 if is_multipart: 270 params = mimeEncode(postdata) 271 h.putheader('Content-type', 'multipart/form-data; boundary=%s'% 272 BOUNDARY) 273 else: 274 params = urlencode(postdata) 275 h.putheader('Content-type', 'application/x-www-form-urlencoded') 268 276 h.putheader('Content-length', str(len(params))) 269 277 else:
