From 091a6f8f4edbfc2a2397a0690aaed863de87daa7 Mon Sep 17 00:00:00 2001 From: Jason Schmidt Date: Thu, 6 Sep 2012 10:55:16 -0400 Subject: [PATCH] Upon further testing, found that ampersands and several other characters break the OS X client as well. Changed my approach to completely escape all path fragments, and this seems to be working for every file I throw at it. Fixes #52 --- lib/DAV/property/response.js | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/lib/DAV/property/response.js b/lib/DAV/property/response.js index 36fd9279..58a50e02 100644 --- a/lib/DAV/property/response.js +++ b/lib/DAV/property/response.js @@ -51,9 +51,16 @@ exports.jsDAV_Property_Response = jsDAV_Property_Response; this.serialize = function(handler, dom) { var properties = this.responseProperties; + // Adding the baseurl to the beginning of the url + var href = handler.server.getBaseUri() + this.href; + href = href.split( '/' ); + href.forEach( function( value , key ) { + href[ key ] = encodeURIComponent( value ); + } ); + href = href.join( '/' ); + dom += "" - // Adding the baseurl to the beginning of the url - + "" + Util.escapeXml(encodeURI(handler.server.getBaseUri() + this.href).replace(/'/g , '%27')) + ""; + + "" + Util.escapeXml(href) + ""; // The properties variable is an array containing properties, grouped by // HTTP status