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

Bug 405012

Summary: Node debug command does not return proper debug URL after upgrading nodejs to version 0.10.3
Product: [ECD] Orion Reporter: libing wang <libingw>
Component: NodeAssignee: libing wang <libingw>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: P3 CC: ken_walker, mamacdon
Version: 2.0   
Target Milestone: 3.0 M1   
Hardware: PC   
OS: Windows 7   
Whiteboard:

Description libing wang CLA 2013-04-05 11:09:17 EDT
Ken found this issue on his Mac with nodejs 0.10.2.
When you use node debug app.js from shell page, the returned debug URL encoded "?"  to "%3F".

nodejs 0.8.14 does not reproduce the issue.
After I upgraded to 0.10.3, I was able to reproduce it.
Comment 1 libing wang CLA 2013-04-09 07:44:38 EDT
Fixed with http://git.eclipse.org/c/orion/org.eclipse.orion.client.git/commit/?id=18560301848fd31eec21ca47fa0301f75d710e4f.

The url.format function in 0.10.3 was changed so that the 'pathname' parameter passed to the function is URI encoded on '?' mark.
In Orion node we were using this function and passed "/debug?port=portNumber" as the pathname of the function. It did not encode the ? mark in 0.8.14.

I read the latest nodejs document(http://nodejs.org/api/url.html) for URL. I realized that we should pass "/debug" as the pathname and {port: portNumber} as another parameter query.
So the proper code that matches the latest nodejs URL spec is something like this :
	return url.format({
			protocol: debugMeta.protocol,
			hostname: hName,
			port:  debugMeta.port,
			pathname: debugMeta.pathname,//"debug"
			query: debugMeta.query //{port: 6001}
		});

We could even just concatenate the hard coded string "/debug?port=portNumber" to the resolved URL but I hate to do so.