Skip to content

Commit

Permalink
Support no options in connector.request()
Browse files Browse the repository at this point in the history
  • Loading branch information
mikepb committed Dec 4, 2011
1 parent 6f36dd4 commit bb00c9e
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion lib/clerk/connector.js
Expand Up @@ -62,7 +62,10 @@ CouchConnector.prototype.request = function(options, callback) {
var self = this;

// convert data to JSON, including functions for views
if (options) {
if (typeof options === 'function') {
callback = options;
options = null;
} else if (options) {
options.headers = options.headers || {};
if (options.data && !options.data.on) {
options.data = JSON.stringify(options.data, function(key, val) {
Expand Down

0 comments on commit bb00c9e

Please sign in to comment.