Added php-opencloud/openstack as SubModule
This commit is contained in:
parent
eac860ce50
commit
81d5c2a646
15 changed files with 282 additions and 178 deletions
|
@ -113,7 +113,7 @@ class MultipartStream implements StreamInterface
|
|||
// Set a default content-disposition header if one was no provided
|
||||
$disposition = $this->getHeader($headers, 'content-disposition');
|
||||
if (!$disposition) {
|
||||
$headers['Content-Disposition'] = $filename
|
||||
$headers['Content-Disposition'] = ($filename === '0' || $filename)
|
||||
? sprintf('form-data; name="%s"; filename="%s"',
|
||||
$name,
|
||||
basename($filename))
|
||||
|
@ -130,7 +130,7 @@ class MultipartStream implements StreamInterface
|
|||
|
||||
// Set a default Content-Type if one was not supplied
|
||||
$type = $this->getHeader($headers, 'content-type');
|
||||
if (!$type && $filename) {
|
||||
if (!$type && ($filename === '0' || $filename)) {
|
||||
if ($type = mimetype_from_filename($filename)) {
|
||||
$headers['Content-Type'] = $type;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue