[connectors/http] prevent errors caused by multi-byte characters in paths (#756)
* [connectors/http] catch errors caused by multi-byte paths * Check url validity before to run the request * Updated test
This commit is contained in:
@ -230,6 +230,17 @@ describe('Http Connector', function () {
|
||||
done();
|
||||
});
|
||||
});
|
||||
|
||||
it('calls back with error when http.request throws an error', function (done) {
|
||||
var con = new HttpConnection(new Host('http://google.com/thisisinvalid\uffe2'));
|
||||
|
||||
stub(con.log, 'error');
|
||||
|
||||
con.request({}, function (err) {
|
||||
expect(err.message).to.eql('ERR_UNESCAPED_CHARACTERS: /thisisinvalid\uffe2');
|
||||
done();
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
describe('#request with incomming message error', function () {
|
||||
|
||||
Reference in New Issue
Block a user