remove URI encoding from attachmentName

This commit is contained in:
Don 2022-12-11 19:38:55 -07:00 committed by GitHub
parent f18ad68297
commit 47dbd7768a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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