Skip to content

Commit 87751e0

Browse files
authored
Merge pull request #421 from noodleswww/master
enhance the method of path.basename, handle undefined case
2 parents 8512eef + faaa68a commit 87751e0

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

lib/form_data.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -230,7 +230,7 @@ FormData.prototype._getContentDisposition = function(value, options) {
230230
filename = path.basename(options.filename || value.name || value.path);
231231
} else if (value.readable && value.hasOwnProperty('httpVersion')) {
232232
// or try http response
233-
filename = path.basename(value.client._httpMessage.path);
233+
filename = path.basename(value.client._httpMessage.path || '');
234234
}
235235

236236
if (filename) {

0 commit comments

Comments
 (0)