Opened 7 years ago

Closed 7 years ago

Last modified 6 years ago

#16408 closed defect (fixed)

request/script test failure

Reported by: bill Owned by: Bryan Forbes
Priority: blocker Milestone: 1.8.4
Component: IO Version: 1.8.1
Keywords: dohfail Cc: dylanks
Blocked By: Blocking:

Description (last modified by bill)

The request/script.html test is failing for me with a test timeout on both IE10 and FF on the jsonp() test. The problem is that the URL to do the jsonp has strange characters:

http://localhost/1.8/dojo/tests/request/scriptDummyMethod.php?foo=bar/[?&]callback=/dojo_request_script_callbacks.dojo_request_script2

It should be:

http://localhost/1.8/dojo/tests/request/scriptDummyMethod.php?foo=bar&callback=/dojo_request_script_callbacks.dojo_request_script2

I traced it down to these lines in dojo/request/script:

var queryParameter = new RegExp('[?&]' + options.jsonp + '=');
if(!queryParameter.test(url)){
	url += queryParameter +
		(options.frameDoc ? 'parent.' : '') +
		mid + '_callbacks.' + dfd.id;
}

Why are you appending a RegExp to the URL string, rather than appending a String? And what were you expecting to happen?

Change History (10)

comment:1 Changed 7 years ago by bill

Description: modified (diff)
Keywords: dohfail added

comment:2 Changed 7 years ago by iCanDo

url += queryParameter +

Remove queryParameter (RegExp?) fix the bug.

comment:3 Changed 7 years ago by wouterd

This issue is still present in 1.8.3.

In dojo/request/script replace

url += queryParameter +
	(options.frameDoc ? 'parent.' : '') +
	mid + '_callbacks.' + dfd.id;

by

url += (~url.indexOf('?') ? '&' : '?') + 
	options.jsonp + '=' + 
	(options.frameDoc ? 'parent.' : '') +
	mid + '_callbacks.' + dfd.id;

comment:4 Changed 7 years ago by dancrumb

Will this be fixed in 1.8.4?

comment:5 Changed 7 years ago by Colin Snover

Milestone: tbd1.8.4
Priority: undecidedblocker
Status: newassigned

comment:6 Changed 7 years ago by Colin Snover

Cc: dylanks added

comment:7 Changed 7 years ago by Bryan Forbes

In [30390]:

Fix adding the callback to the URL. refs #16408 !strict

comment:8 Changed 7 years ago by Bryan Forbes

In [30391]:

Fix adding the callback to the URL (1.8 backport). refs #16408 !strict

comment:9 Changed 7 years ago by Bryan Forbes

Resolution: fixed
Status: assignedclosed

comment:10 Changed 6 years ago by bill

#17094 is a duplicate of this ticket.

Note: See TracTickets for help on using tickets.