mirror of
https://github.com/sqlmapproject/sqlmap.git
synced 2024-11-22 01:26:42 +03:00
Fixes #1425
This commit is contained in:
parent
aa088aafd2
commit
29bdcf0e65
4
thirdparty/multipart/multipartpost.py
vendored
4
thirdparty/multipart/multipartpost.py
vendored
|
@ -73,7 +73,7 @@ class MultipartPostHandler(urllib2.BaseHandler):
|
|||
request.add_data(data)
|
||||
return request
|
||||
|
||||
def multipart_encode(vars, files, boundary = None, buf = None):
|
||||
def multipart_encode(vars, files, boundary=None, buf=None):
|
||||
if boundary is None:
|
||||
boundary = mimetools.choose_boundary()
|
||||
|
||||
|
@ -100,7 +100,7 @@ class MultipartPostHandler(urllib2.BaseHandler):
|
|||
# buf += 'Content-Length: %s\r\n' % file_size
|
||||
fd.seek(0)
|
||||
|
||||
buf = str(buf)
|
||||
buf = str(buf) if not isinstance(buf, unicode) else buf.encode("utf8")
|
||||
buf += '\r\n%s\r\n' % fd.read()
|
||||
|
||||
buf += '--%s--\r\n\r\n' % boundary
|
||||
|
|
Loading…
Reference in New Issue
Block a user