webdav-test
Advanced tools
Comparing version 1.1.7 to 1.1.8
@@ -15,2 +15,11 @@ "use strict"; | ||
function splitInvalidURL(url) { | ||
var sections = url.split("/"); | ||
url = {}; | ||
url.protocol = sections[0] + '//'; | ||
url.hostname = sections[2]; | ||
url.path = '/' + sections.slice(3, sections.length).join('/'); | ||
return url; | ||
} | ||
function request(fullUrl, options) { | ||
@@ -21,6 +30,6 @@ console.log("REQUEST: URL"); | ||
console.log(options); | ||
var splitUrl = new URL(fullUrl); | ||
var encodedURI = encodeURIPath(splitUrl.pathname); | ||
console.log(splitUrl.origin + encodedURI); | ||
return fetchMethod(splitUrl.origin + encodedURI, options); | ||
var splitUrl = splitInvalidURL(fullUrl); | ||
var encodedURI = encodeURIPath(splitUrl.path); | ||
console.log(encodedURI); | ||
return fetchMethod(splitUrl.protocol + splitUrl.hostname + encodedURI, options); | ||
} | ||
@@ -27,0 +36,0 @@ |
{ | ||
"name": "webdav-test", | ||
"version": "1.1.7", | ||
"version": "1.1.8", | ||
"description": "WebDAV client for NodeJS", | ||
@@ -5,0 +5,0 @@ "main": "dist/index.js", |
@@ -15,3 +15,12 @@ "use strict"; | ||
function splitInvalidURL(url){ | ||
const sections = url.split("/"); | ||
url = {}; | ||
url.protocol = sections[0] + '//'; | ||
url.hostname = sections[2]; | ||
url.path = '/' + sections.slice(3, sections.length).join('/'); | ||
return url; | ||
} | ||
function request(fullUrl, options) { | ||
@@ -22,6 +31,6 @@ console.log("REQUEST: URL"); | ||
console.log(options); | ||
const splitUrl = new URL(fullUrl); | ||
const encodedURI = encodeURIPath(splitUrl.pathname); | ||
console.log(splitUrl.origin + encodedURI); | ||
return fetchMethod(splitUrl.origin + encodedURI, options); | ||
const splitUrl = splitInvalidURL(fullUrl); | ||
const encodedURI = encodeURIPath(splitUrl.path); | ||
console.log(encodedURI); | ||
return fetchMethod(splitUrl.protocol + splitUrl.hostname + encodedURI, options); | ||
} | ||
@@ -28,0 +37,0 @@ |
293275
2010