From 47dbd7768ae409a52bbddec32674743a96defbd0 Mon Sep 17 00:00:00 2001 From: Don Date: Sun, 11 Dec 2022 19:38:55 -0700 Subject: [PATCH] remove URI encoding from attachmentName --- scripts/attachment.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/scripts/attachment.js b/scripts/attachment.js index a19ba61..8ddaba0 100644 --- a/scripts/attachment.js +++ b/scripts/attachment.js @@ -7,7 +7,7 @@ var Attachment = function (slouch) { Attachment.prototype.create = function (dbName, docId, attachmentName, data, contentType, rev) { return this._slouch._req({ uri: this._slouch._url + '/' + encodeURIComponent(dbName) + '/' + encodeURIComponent( - docId) + '/' + encodeURIComponent(attachmentName) + '?rev=' + encodeURIComponent(rev), + docId) + '/' + attachmentName + '?rev=' + encodeURIComponent(rev), method: 'PUT', headers: { 'Content-Type': contentType @@ -23,7 +23,7 @@ Attachment.prototype.create = function (dbName, docId, attachmentName, data, con Attachment.prototype.get = function (dbName, docId, attachmentName) { return this._slouch._req({ uri: this._slouch._url + '/' + encodeURIComponent(dbName) + '/' + encodeURIComponent( - docId) + '/' + encodeURIComponent(attachmentName), + docId) + '/' + attachmentName, method: 'GET', raw: true, encoding: null @@ -35,7 +35,7 @@ Attachment.prototype.get = function (dbName, docId, attachmentName) { Attachment.prototype.destroy = function (dbName, docId, attachmentName, rev) { return this._slouch._req({ uri: this._slouch._url + '/' + encodeURIComponent(dbName) + '/' + encodeURIComponent( - docId) + '/' + encodeURIComponent(attachmentName), + docId) + '/' + attachmentName, method: 'DELETE', qs: { rev: rev