webdav-test
Advanced tools
Comparing version 1.1.6 to 1.1.7
@@ -7,11 +7,10 @@ "use strict"; | ||
// function encodeURIPath(path) { | ||
// const uriSections = path.split("/"); | ||
// for (let i = 0; i < uriSections.length; i += 1) { | ||
// uriSections[i] = encodeURIComponent(uriSections[i]); | ||
// } | ||
// return uriSections.join("/"); | ||
// } | ||
function encodeURIPath(uriPath) { | ||
var uriSections = uriPath.split("/"); | ||
for (var i = 0; i < uriSections.length; i += 1) { | ||
uriSections[i] = encodeURIComponent(uriSections[i]); | ||
} | ||
return uriSections.join("/"); | ||
} | ||
function request(fullUrl, options) { | ||
@@ -23,5 +22,5 @@ console.log("REQUEST: URL"); | ||
var splitUrl = new URL(fullUrl); | ||
// const encodedURI = encodeURIPath(splitUrl.pathname); | ||
console.log(splitUrl); | ||
return fetchMethod(fullUrl, options); | ||
var encodedURI = encodeURIPath(splitUrl.pathname); | ||
console.log(splitUrl.origin + encodedURI); | ||
return fetchMethod(splitUrl.origin + encodedURI, options); | ||
} | ||
@@ -28,0 +27,0 @@ |
{ | ||
"name": "webdav-test", | ||
"version": "1.1.6", | ||
"version": "1.1.7", | ||
"description": "WebDAV client for NodeJS", | ||
@@ -5,0 +5,0 @@ "main": "dist/index.js", |
@@ -7,9 +7,9 @@ "use strict"; | ||
// function encodeURIPath(path) { | ||
// const uriSections = path.split("/"); | ||
// for (let i = 0; i < uriSections.length; i += 1) { | ||
// uriSections[i] = encodeURIComponent(uriSections[i]); | ||
// } | ||
// return uriSections.join("/"); | ||
// } | ||
function encodeURIPath(uriPath) { | ||
const uriSections = uriPath.split("/"); | ||
for (let i = 0; i < uriSections.length; i += 1) { | ||
uriSections[i] = encodeURIComponent(uriSections[i]); | ||
} | ||
return uriSections.join("/"); | ||
} | ||
@@ -23,5 +23,5 @@ | ||
const splitUrl = new URL(fullUrl); | ||
// const encodedURI = encodeURIPath(splitUrl.pathname); | ||
console.log(splitUrl); | ||
return fetchMethod(fullUrl, options); | ||
const encodedURI = encodeURIPath(splitUrl.pathname); | ||
console.log(splitUrl.origin + encodedURI); | ||
return fetchMethod(splitUrl.origin + encodedURI, options); | ||
} | ||
@@ -28,0 +28,0 @@ |
292782