Permalink
Browse files

Inject http/https options - #54

  • Loading branch information...
1 parent b25bcd4 commit 1b1de3ff60e6572213c0d0d8d27847d732882dc1 @obazoud obazoud committed Nov 7, 2013
Showing with 13 additions and 5 deletions.
  1. +7 −3 lib/sources/http.js
  2. +6 −2 lib/sources/https.js
View
@@ -1,17 +1,21 @@
var http = require('http'),
- checkHttpValueResponse = require('../checks/httpValueResponse').execute;
+ checkHttpValueResponse = require('../checks/httpValueResponse').execute,
+ _ = require('underscore');
exports.check = function(serviceDefinition, service, callback) {
/**
- HTTP module options
+ HTTP options
*/
- var options = {
+ var httpOptions = {
host: serviceDefinition.host,
port: serviceDefinition.port,
path: serviceDefinition.path,
headers: serviceDefinition.headers
};
+ var options = {};
+ _.extend(options, httpOptions, serviceDefinition.options);
+
/**
HTTP call and error handling
*/
View
@@ -1,17 +1,21 @@
var https = require('https'),
- checkHttpValueResponse = require('../checks/httpValueResponse').execute;
+ checkHttpValueResponse = require('../checks/httpValueResponse').execute,
+ _ = require('underscore');
exports.check = function(serviceDefinition, service, callback) {
/**
HTTPS options
*/
- var options = {
+ var httpsOptions = {
host: serviceDefinition.host,
port: serviceDefinition.port,
path: serviceDefinition.path,
headers: serviceDefinition.headers
};
+ var options = {};
+ _.extend(options, httpsOptions, serviceDefinition.options);
+
/**
HTTPS call and error handling
*/

0 comments on commit 1b1de3f

Please sign in to comment.