Skip to content
Browse files

too much encodeURIComponent found on getDoc

  • Loading branch information...
1 parent e4f942c commit d2c598232e4f7658b86fd84ee10229633d5b83ad @landeiro committed Aug 9, 2011
Showing with 6 additions and 5 deletions.
  1. +6 −5 lib/PJsonCouch.js
View
11 lib/PJsonCouch.js
@@ -400,7 +400,7 @@ var PJsonCouch = function (options) {
if (url.id) {
url.id = encodeURIComponent(url.id);
}
- var getOptions = this.buildRequest("GET", encodeURIComponent(url), options);
+ var getOptions = this.buildRequest("GET", url, options);
Utils.request(getOptions, "", config, function (doc) {
if (callBackFunction) {
callBackFunction(doc);
@@ -521,15 +521,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 d2c5982

Please sign in to comment.
Something went wrong with that request. Please try again.