mirror of
https://github.com/sqlmapproject/sqlmap.git
synced 2024-11-22 01:26:42 +03:00
Patch for an Issue #997
This commit is contained in:
parent
bd99470a4a
commit
ff0dd8eefe
6
thirdparty/multipart/multipartpost.py
vendored
6
thirdparty/multipart/multipartpost.py
vendored
|
@ -88,7 +88,11 @@ class MultipartPostHandler(urllib2.BaseHandler):
|
|||
for (key, fd) in files:
|
||||
file_size = os.fstat(fd.fileno())[stat.ST_SIZE] if isinstance(fd, file) else fd.len
|
||||
filename = fd.name.split('/')[-1] if '/' in fd.name else fd.name.split('\\')[-1]
|
||||
contenttype = mimetypes.guess_type(filename)[0] or 'application/octet-stream'
|
||||
try:
|
||||
contenttype = mimetypes.guess_type(filename)[0] or 'application/octet-stream'
|
||||
except:
|
||||
# Reference: http://bugs.python.org/issue9291
|
||||
contenttype = 'application/octet-stream'
|
||||
buf += '--%s\r\n' % boundary
|
||||
buf += 'Content-Disposition: form-data; name="%s"; filename="%s"\r\n' % (key, filename)
|
||||
buf += 'Content-Type: %s\r\n' % contenttype
|
||||
|
|
Loading…
Reference in New Issue
Block a user