Fixed Non-ASCII attachment filename will crash when downloading.

Thanks to xet7 !

Fixes #2759
This commit is contained in:
Lauri Ojansivu 2021-04-29 13:26:49 +03:00
parent 843ff8eaaa
commit c2da477735
277 changed files with 30568 additions and 52 deletions

View file

@ -0,0 +1,26 @@
var assert = require('assert')
, request = require('../index')
, http = require('http')
;
var s = http.createServer(function(req, res) {
res.statusCode = 200
res.end('')
}).listen(6767, function () {
// a simple request should not fail with NODE_DEBUG
process.env.NODE_DEBUG = 'mumblemumble,request'
var stderr = ''
process.stderr.write = (function(write) {
return function(string, encoding, fd) {
stderr += string
}
})(process.stderr.write)
request('http://localhost:6767', function (err, resp, body) {
assert.ifError(err, 'the request did not fail')
assert.ok(resp, 'the request did not fail')
assert.ok(/REQUEST/.test(stderr), 'stderr has some messages')
s.close(); // clean up
})
})