diff --git a/lib/server/commands/Propfind.js b/lib/server/commands/Propfind.js index 76931769..e00d9e3a 100644 --- a/lib/server/commands/Propfind.js +++ b/lib/server/commands/Propfind.js @@ -248,7 +248,7 @@ function method(arg, callback) { activelock.ele('D:owner').add(lock.owner); activelock.ele('D:timeout').add('Second-' + (lock.expirationDate - Date.now())); activelock.ele('D:locktoken').ele('D:href', undefined, true).add(lock.uuid); - activelock.ele('D:lockroot').ele('D:href', undefined, true).add(arg.fullUri(path_1).replace(' ', '%20')); + activelock.ele('D:lockroot').ele('D:href', undefined, true).add(encodeURI(arg.fullUri(path_1))); } } nbOut(null); @@ -259,7 +259,7 @@ function method(arg, callback) { nbOut(e); return; } - var p = arg.fullUri(path).replace(' ', '%20'); + var p = encodeURI(arg.fullUri(path)); var href = p.lastIndexOf('/') !== p.length - 1 && type.isDirectory ? p + '/' : p; response.ele('D:href', undefined, true).add(href); response.ele('D:location').ele('D:href', undefined, true).add(p); @@ -294,7 +294,7 @@ function method(arg, callback) { methodDisplayName = resource.displayName; methodDisplayName.bind(resource)(function (e, name) { return process.nextTick(function () { if (!e) - tags.displayname.el.add(name ? name : ''); + tags.displayname.el.add(name ? encodeURI(name) : ''); nbOut(e); }); }); }); diff --git a/lib/server/commands/Proppatch.js b/lib/server/commands/Proppatch.js index ddad8c2b..5f99f6da 100644 --- a/lib/server/commands/Proppatch.js +++ b/lib/server/commands/Proppatch.js @@ -17,7 +17,7 @@ function method(arg, callback) { 'xmlns:D': 'DAV:' }); var response = multistatus.ele('D:response'); - response.ele('D:href', undefined, true).add(arg.fullUri()); + response.ele('D:href', undefined, true).add(encodeURI(arg.fullUri())); try { var xml = XML_1.XML.parse(arg.data); var root_1 = xml.find('DAV:propertyupdate'); diff --git a/src/server/commands/Propfind.ts b/src/server/commands/Propfind.ts index 089d5111..0227dee8 100644 --- a/src/server/commands/Propfind.ts +++ b/src/server/commands/Propfind.ts @@ -329,7 +329,7 @@ export function method(arg : MethodCallArgs, callback) activelock.ele('D:owner').add(lock.owner) activelock.ele('D:timeout').add('Second-' + (lock.expirationDate - Date.now())) activelock.ele('D:locktoken').ele('D:href', undefined, true).add(lock.uuid) - activelock.ele('D:lockroot').ele('D:href', undefined, true).add(arg.fullUri(path).replace(' ', '%20')) + activelock.ele('D:lockroot').ele('D:href', undefined, true).add(encodeURI(arg.fullUri(path))) } } @@ -344,7 +344,7 @@ export function method(arg : MethodCallArgs, callback) return; } - const p = arg.fullUri(path).replace(' ', '%20'); + const p = encodeURI(arg.fullUri(path)); const href = p.lastIndexOf('/') !== p.length - 1 && type.isDirectory ? p + '/' : p; response.ele('D:href', undefined, true).add(href); response.ele('D:location').ele('D:href', undefined, true).add(p); @@ -390,7 +390,7 @@ export function method(arg : MethodCallArgs, callback) methodDisplayName.bind(resource)((e, name) => process.nextTick(() => { if(!e) - tags.displayname.el.add(name ? name : ''); + tags.displayname.el.add(name ? encodeURI(name) : ''); nbOut(e); })) }) diff --git a/src/server/commands/Proppatch.ts b/src/server/commands/Proppatch.ts index 657c13c1..d90376da 100644 --- a/src/server/commands/Proppatch.ts +++ b/src/server/commands/Proppatch.ts @@ -21,7 +21,7 @@ export function method(arg : MethodCallArgs, callback) 'xmlns:D': 'DAV:' }); const response = multistatus.ele('D:response'); - response.ele('D:href', undefined, true).add(arg.fullUri()); + response.ele('D:href', undefined, true).add(encodeURI(arg.fullUri())); try {