heroku-client
Advanced tools
Comparing version 1.1.0 to 1.1.1
@@ -164,8 +164,10 @@ var http = require('http'), | ||
Request.prototype.writeBody = function writeBody (req) { | ||
if (!this.options.body) return; | ||
if (this.options.body) { | ||
var body = JSON.stringify(this.options.body); | ||
var body = JSON.stringify(this.options.body); | ||
req.setHeader('Content-length', body.length); | ||
req.write(body); | ||
req.setHeader('Content-length', body.length); | ||
req.write(body); | ||
} else { | ||
req.setHeader('Content-length', 0); | ||
} | ||
} | ||
@@ -172,0 +174,0 @@ |
{ | ||
"name": "heroku-client", | ||
"version": "1.1.0", | ||
"version": "1.1.1", | ||
"description": "A wrapper for the Heroku v3 API", | ||
@@ -21,2 +21,4 @@ "main": "./lib/heroku.js", | ||
"name": "Ray McDermott" | ||
}, { | ||
"name": "Bob Zoller" | ||
}], | ||
@@ -23,0 +25,0 @@ "license": "MIT", |
@@ -126,2 +126,6 @@ # heroku-client [![Build Status](https://travis-ci.org/jclem/node-heroku-client.png?branch=master)](https://travis-ci.org/jclem/node-heroku-client) | ||
### HTTP Proxies | ||
If you'd like to make requests through an HTTP proxy, set the `HEROKU_HTTP_PROXY_HOST` environment variable with your proxy host, and `HEROKU_HTTP_PROXY_PORT` with the desired port (defaults to 8080). heroku-client will then make requests through this proxy instead of directly to api.heroku.com. | ||
## Caching | ||
@@ -128,0 +132,0 @@ |
@@ -50,2 +50,11 @@ var http = require('http'), | ||
it('sets the Content-length to 0 when a body is not present', function(done) { | ||
spyOn(MockRequest.prototype, 'setHeader'); | ||
makeRequest('/apps/example/collaborators/bob%40example.com', { method: 'DELETE' }, function() { | ||
expect(MockRequest.prototype.setHeader).toHaveBeenCalledWith('Content-length', 0); | ||
done(); | ||
}); | ||
}); | ||
describe('when using an HTTP proxy', function() { | ||
@@ -52,0 +61,0 @@ beforeEach(function() { |
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
172172
4604
185