Permalink
Browse files

Merged updates from upstream repo

  • Loading branch information...
2 parents 59b627b + d2c5982 commit 8297094362d013353edf703c1fc9e7e34e24a6a9 @DamonOehlman DamonOehlman committed Aug 10, 2011
Showing with 7 additions and 5 deletions.
  1. +7 −5 lib/PJsonCouch.js
View
@@ -404,7 +404,8 @@ var PJsonCouch = function (options) {
if (url.id) {
url.id = encodeURIComponent(url.id);
}
- var getOptions = this.buildRequest("GET", encodeURIComponent(url));
+
+ var getOptions = this.buildRequest("GET", url, options);
Utils.request(getOptions, "", config, function (doc) {
if (callBackFunction) {
callBackFunction(doc);
@@ -525,15 +526,16 @@ var PJsonCouch = function (options) {
options.path = Utils.decodeGetData(url);
options.method = method;
options.path = (qsparams === "") ? options.path : options.path + "?" + qsparams;
+ if (options.headers === undefined) {
+ options.headers = {};
+ }
if (method !== "GET") {
- options.headers = {"Content-Type": "application/json"};
+ options.headers["Content-Type"] = "application/json";
}
if (mySession !== "") {
- if (options.headers === undefined) {
- options.headers = {};
- }
+
options.headers["Cookie"] = "AuthSession=" + mySession;
}

0 comments on commit 8297094

Please sign in to comment.