Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 397982

Summary: Remove URL encoding from xhr.js
Product: [ECD] Orion Reporter: Mark Macdonald <mamacdon>
Component: ClientAssignee: Mark Macdonald <mamacdon>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: P3 CC: malgorzata.tomczyk, simon_kaegi
Version: 2.0   
Target Milestone: 2.0 M2   
Hardware: PC   
OS: Windows 7   
Whiteboard:

Description Mark Macdonald CLA 2013-01-11 10:25:18 EST
Currently orion/xhr depends on the orion/urlencode library, for two things:

 1. encoding the URI query string
 2. encoding form data (application/x-www-form-urlencoded)

The dependency should be removed. Callers who rely on xhr doing #1 should instead use a URI template and pass the resulting URL to the xhr() call. 

For #2, clients should explicitly call urlencode to encode their form data, and pass the resulting encoded string to xhr().
Comment 1 Mark Macdonald CLA 2013-01-11 17:19:49 EST
Actually I guess you're supposed to use URL-shim.js instead
Comment 2 Mark Macdonald CLA 2013-01-24 19:16:57 EST
OK this is done:
http://git.eclipse.org/c/orion/org.eclipse.orion.client.git/commit/?id=40b0db774453ad3e73bc6d6de784f6e20024fc59

The "query" argument to xhr is gone. All its callers have been changed to import URL-shim, and use the URLQuery API to construct a URL with the desired query params in it. Then that URL is passed to xhr().

urlencode.js has been deleted. The only remaining method, which dealt with encoding x-www-form-urlencoded data, now lives in form.js .