mirror of
https://github.com/wekan/wekan.git
synced 2026-02-09 01:34:21 +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
39
packages/wekan-request/tests/test-proxy-null.js
Normal file
39
packages/wekan-request/tests/test-proxy-null.js
Normal file
|
|
@ -0,0 +1,39 @@
|
|||
var server = require('./server')
|
||||
, events = require('events')
|
||||
, stream = require('stream')
|
||||
, assert = require('assert')
|
||||
, fs = require('fs')
|
||||
, request = require('../index')
|
||||
, path = require('path')
|
||||
, util = require('util')
|
||||
;
|
||||
|
||||
var port = 6768
|
||||
, called = false
|
||||
, proxiedHost = 'google.com'
|
||||
;
|
||||
|
||||
// set up environment variable
|
||||
process.env.HTTP_PROXY = 'http://localhost:'+port;
|
||||
|
||||
var s = server.createServer(port)
|
||||
s.listen(port, function () {
|
||||
s.on('http://google.com/', function (req, res) {
|
||||
called = true
|
||||
assert.equal(req.headers.host, proxiedHost)
|
||||
res.writeHeader(200)
|
||||
res.end()
|
||||
})
|
||||
request ({
|
||||
url: 'http://'+proxiedHost,
|
||||
// should not read from HTTP_PROXY env var
|
||||
proxy: null,
|
||||
timeout: 500,
|
||||
}, function (err, res, body) {
|
||||
s.close()
|
||||
})
|
||||
})
|
||||
|
||||
process.on('exit', function () {
|
||||
assert.ok(!called, 'the request must not be made to the proxy server')
|
||||
})
|
||||
Loading…
Add table
Add a link
Reference in a new issue