Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

addresses comments on pull request to whump/iodocs

 * add content-length header when content is non-zero length
 * include query parameters for POST/PUT/DELETE if they are given
  • Loading branch information...
commit cb5bb845871f0457de59ac99aaf5f279dc871556 1 parent 32da352
@dgc-wh dgc-wh authored
Showing with 6 additions and 4 deletions.
  1. +6 −4 app.js
View
10 app.js
@@ -356,7 +356,7 @@ function processRequest(req, res, next) {
host: baseHostUrl,
port: baseHostPort,
method: httpMethod,
- path: apiConfig.publicPath + methodURL// + ((paramString.length > 0) ? '?' + paramString : "")
+ path: apiConfig.publicPath + methodURL + ((paramString.length > 0) ? '?' + paramString : "")
};
if (apiConfig.oauth) {
@@ -509,9 +509,7 @@ function processRequest(req, res, next) {
function unsecuredCall() {
console.log('Unsecured Call');
- if (['POST','PUT','DELETE'].indexOf(httpMethod) === -1) {
- options.path += ((paramString.length > 0) ? '?' + paramString : "");
- }
+ options.path += ((paramString.length > 0) ? '?' + paramString : "");
// Add API Key to params, if any.
if (apiKey != '' && apiKey != 'undefined' && apiKey != undefined) {
@@ -559,6 +557,10 @@ function processRequest(req, res, next) {
options.headers = headers;
}
+ if (content.length > 0) {
+ options.headers['Content-Length'] = content.length;
+ }
+
if (config.debug) {
console.log(util.inspect(options));
Please sign in to comment.
Something went wrong with that request. Please try again.