Opened 7 years ago

Closed 7 years ago

#17094 closed defect (duplicate)

Bug in dojo/request/script

Reported by: rmasse Owned by:
Priority: undecided Milestone: tbd
Component: IO Version: 1.8.3
Keywords: Cc:
Blocked By: Blocking:


We've come across a bug when using dojo/request/script on a url ending in json when using {jsonp: "callback"}.

This bug manifested itself in 1.8 and did not present itself in 1.7.

When inspecting the request, the url is improperly manipulated and resembles this:[?&]callback=thecallback

I've narrowed it down to line 134 (url += queryParameter) as listed below.


var queryParameter = new RegExp?('?&' + options.jsonp + '='); if(!queryParameter.test(url)){

url += queryParameter +

(options.frameDoc ? 'parent.' : ) + mid + '_callbacks.' +;


dfd.canDelete = true; callbacks[] = function(json){ = json; dfd.handleResponse(response);



I've replaced url += queryParameter + with url += '?'+options.jsonp+'='+ in the source and the problem is solved.

As coded, the regex string is injected into the url which it shouldn't be.

Let me know if you need more info.


Change History (1)

comment:1 Changed 7 years ago by bill

Component: GeneralIO
Resolution: duplicate
Status: newclosed

Duplicate of #16408.

Note: See TracTickets for help on using tickets.