Repository: urllib3/urllib3

Issue:
Multipart request headers do not work properly for values of empty string
Continuing the discussion from https://github.com/sigmavirus24/requests-toolbelt/issues/162, attempting to create a `RequestField` which is then made multipart via `make_multipart` does not work properly if the filename given is an empty string.

urllib3 test code:

```
from urllib3.fields import RequestField
field = RequestField(name="somename", data="somedata", filename="")
field.make_multipart(content_type="application/octet-stream")
print(field.headers)
```

Expected output:

```
{'Content-Type': 'application/octet-stream', 'Content-Location': None, 'Content-Disposition': 'form-data; name="somename"; filename=""'}
```

Actual output:

```
{'Content-Type': 'application/octet-stream', 'Content-Location': None, 'Content-Disposition': 'form-data; name="somename"'}
```
## 



Discussion:
A test made in Chrome and Firefox on macOS shows that the `filename` field should be present in the content disposition even if the value is empty (such as when an optional input tag on a webpage accepts multiple files and none are provided).

Chrome 55:

```
------WebKitFormBoundaryCvXp0tseQuZuGTru
Content-Disposition: form-data; name="somename"; filename=""
Content-Type: application/octet-stream


------WebKitFormBoundaryCvXp0tseQuZuGTru--
```

Firefox 49:

```
-----------------------------1681649282594654441443913898
Content-Disposition: form-data; name="somename"; filename=""
Content-Type: application/octet-stream


-----------------------------1681649282594654441443913898--
```

Flask server code I wrote to test the request payload from Chrome:

```
from flask import Flask, request
app = Flask(__name__)

@app.route('/', methods=['GET'])
def multipart_form():
    return '<form name="testform" action="" enctype="multipart/form-data" method="post"><input id="file" type="file" multiple="multiple" name="somename"><input id="post" type="submit" value="Go"></form>'

@app.route('/', methods=['POST'])
def upload_handler():
    print(request.files['somename'])
    return 'ok'
```

I'm happy to accept a PR to change this behaviour. =)


Resolving patch:
diff --git a/urllib3/fields.py b/urllib3/fields.py
--- a/urllib3/fields.py
+++ b/urllib3/fields.py
@@ -130,7 +130,7 @@ def _render_parts(self, header_parts):
             iterable = header_parts.items()
 
         for name, value in iterable:
-            if value:
+            if value is not None:
                 parts.append(self._render_part(name, value))
 
         return '; '.join(parts)


Test patch:
diff --git a/test/test_fields.py b/test/test_fields.py
--- a/test/test_fields.py
+++ b/test/test_fields.py
@@ -36,6 +36,15 @@ def test_make_multipart(self):
             'Content-Location: /test\r\n'
             '\r\n')
 
+    def test_make_multipart_empty_filename(self):
+        field = RequestField('somename', 'data', '')
+        field.make_multipart(content_type='application/octet-stream')
+        self.assertEqual(
+            field.render_headers(),
+            'Content-Disposition: form-data; name="somename"; filename=""\r\n'
+            'Content-Type: application/octet-stream\r\n'
+            '\r\n')
+
     def test_render_parts(self):
         field = RequestField('somename', 'data')
         parts = field._render_parts({'name': 'value', 'filename': 'value'})