Comparing version 5.1.2 to 5.1.3
@@ -185,3 +185,3 @@ "use strict"; | ||
this.options.agent = this.options.agent || deps_1.deps.proxy.agent(this.secure); | ||
this.options.port = u.port || (this.secure ? 443 : 80); | ||
this.options.port = u.port || this.options.port || (this.secure ? 443 : 80); | ||
} | ||
@@ -285,2 +285,3 @@ get headers() { | ||
this.request.on('error', reject); | ||
this.request.on('timeout', reject); | ||
if (this.options.body && deps_1.deps.isStream.readable(this.options.body)) { | ||
@@ -287,0 +288,0 @@ this.options.body.pipe(this.request); |
@@ -48,2 +48,8 @@ "use strict"; | ||
}); | ||
test('allows specifying the port', async () => { | ||
api = nock('https://api.jdxcode.com:3000'); | ||
api.get('/').reply(200, { message: 'ok' }); | ||
let { body } = await http_1.HTTP.get('https://api.jdxcode.com', { port: 3000 }); | ||
expect(body).toEqual({ message: 'ok' }); | ||
}); | ||
test('makes a http GET request', async () => { | ||
@@ -50,0 +56,0 @@ api = nock('http://api.jdxcode.com'); |
{ | ||
"name": "http-call", | ||
"description": "make http requests", | ||
"version": "5.1.2", | ||
"version": "5.1.3", | ||
"author": "Jeff Dickey @jdxcode", | ||
@@ -20,7 +20,7 @@ "bugs": "https://github.com/heroku/http-call/issues", | ||
"@types/nock": "^9.1.3", | ||
"@types/node": "^9.6.6", | ||
"@types/node": "^10.1.1", | ||
"jest": "^22.4.3", | ||
"nock": "^9.2.5", | ||
"ts-jest": "^22.4.4", | ||
"tslint": "^5.9.1", | ||
"nock": "^9.2.6", | ||
"ts-jest": "^22.4.6", | ||
"tslint": "^5.10.0", | ||
"typescript": "^2.8.3" | ||
@@ -27,0 +27,0 @@ }, |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
37848
1024