• Nick Stenning's avatar
    Encode semicolons in query parameters · 224ca5dd
    Nick Stenning authored
    Angular 1.4.x introduced a breaking change (undocumented in the
    upgrading guide as far as I can tell) to the way URL query parameters
    are handled in ajax requests.
    
    Specifically, semicolons in query parameter values are no longer encoded
    by default. This causes problems for us in request urls such as
    
        /api/search?uri=http:%2F%2Fexample.com/?id=4;display=print
    
    because Pyramid interprets the semicolon (correctly according to
    RFC3986) as a query string delimiter.
    
    This commit fixes the issue by overriding the default parameter
    serializer (although only for the ngResource objects in the store
    service) with a much more conservative one that encodes everything with
    `encodeURIComponent`.
    
    The bulk of the code here is a slightly modified version of the default
    serializer used by Angular.
    224ca5dd
store.js 3.86 KB