mirror of
https://github.com/wekan/wekan.git
synced 2026-02-27 02:14:06 +01:00
Fixed Non-ASCII attachment filename will crash when downloading.
Thanks to xet7 ! Fixes #2759
This commit is contained in:
parent
843ff8eaaa
commit
c2da477735
277 changed files with 30568 additions and 52 deletions
23
packages/wekan-request/tests/test-agentOptions.js
Normal file
23
packages/wekan-request/tests/test-agentOptions.js
Normal file
|
|
@ -0,0 +1,23 @@
|
|||
var request = require('../index')
|
||||
, http = require('http')
|
||||
, server = require('./server')
|
||||
, assert = require('assert')
|
||||
;
|
||||
|
||||
var s = http.createServer(function (req, resp) {
|
||||
resp.statusCode = 200
|
||||
resp.end('')
|
||||
}).listen(6767, function () {
|
||||
// requests without agentOptions should use global agent
|
||||
var r = request('http://localhost:6767', function (e, resp, body) {
|
||||
assert.deepEqual(r.agent, http.globalAgent);
|
||||
assert.equal(Object.keys(r.pool).length, 0);
|
||||
|
||||
// requests with agentOptions should apply agentOptions to new agent in pool
|
||||
var r2 = request('http://localhost:6767', { agentOptions: { foo: 'bar' } }, function (e, resp, body) {
|
||||
assert.deepEqual(r2.agent.options, { foo: 'bar' });
|
||||
assert.equal(Object.keys(r2.pool).length, 1);
|
||||
s.close()
|
||||
});
|
||||
})
|
||||
})
|
||||
Loading…
Add table
Add a link
Reference in a new issue