Skip to content

Commit

Permalink
Upon further testing, found that ampersands and several other charact…
Browse files Browse the repository at this point in the history
…ers 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 mikedeboer#52
  • Loading branch information
zannalov committed Sep 6, 2012
1 parent 60e4d2f commit 091a6f8
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions lib/DAV/property/response.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 += "<d:response>"
// Adding the baseurl to the beginning of the url
+ "<d:href>" + Util.escapeXml(encodeURI(handler.server.getBaseUri() + this.href).replace(/'/g , '%27')) + "</d:href>";
+ "<d:href>" + Util.escapeXml(href) + "</d:href>";

// The properties variable is an array containing properties, grouped by
// HTTP status
Expand Down

0 comments on commit 091a6f8

Please sign in to comment.