Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

Issue #52: Apostrophes break OS X client #53

Open
wants to merge 3 commits into from

1 participant

@zannalov

No description provided.

zannalov added some commits
@zannalov zannalov Apostrophes break OS X client, apparently. This fixes #52 by explicit…
…ly encoding apostrophes as well.
60e4d2f
@zannalov zannalov Upon further testing, found that ampersands and several other charact…
…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 #52
091a6f8
@zannalov zannalov I spoke too soon. Previous commit reintroduced the problem with quote…
… marks while fixing most other characters. Forgot to go back and test the original problem. This has been tested with quote marks, double quote marks, ampersands, dashes, spaces, etc. Fixes #52
9b0f694
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Sep 4, 2012
  1. @zannalov

    Apostrophes break OS X client, apparently. This fixes #52 by explicit…

    zannalov authored
    …ly encoding apostrophes as well.
Commits on Sep 6, 2012
  1. @zannalov

    Upon further testing, found that ampersands and several other charact…

    zannalov authored
    …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 #52
  2. @zannalov

    I spoke too soon. Previous commit reintroduced the problem with quote…

    zannalov authored
    … marks while fixing most other characters. Forgot to go back and test the original problem. This has been tested with quote marks, double quote marks, ampersands, dashes, spaces, etc. Fixes #52
This page is out of date. Refresh to see the latest.
Showing with 13 additions and 2 deletions.
  1. +13 −2 lib/DAV/property/response.js
View
15 lib/DAV/property/response.js
@@ -51,9 +51,20 @@ 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 ) {
+ value = encodeURIComponent( value );
+ value = value.replace( /[^a-zA-Z0-9%]/g , function( x ) {
+ return '%' + x.charCodeAt( 0 ).toString( 16 );
+ } );
+ href[ key ] = 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)) + "</d:href>";
+ + "<d:href>" + Util.escapeXml(href) + "</d:href>";
// The properties variable is an array containing properties, grouped by
// HTTP status
Something went wrong with that request. Please try again.