belzebu
belzebu

Reputation: 820

Dojo: dojo/text & CORS

I'm using dojo version 1.9.1 and trying to access the widgets I have created from other domain from where they reside. I'm getting the

"No 'Access-Control-Allow-Origin' header is present on the requested resource"

for everything that is trying to be loaded via dojo/text!, so basically to all my templates. I reckon interning them using the build should be just fine, but other resources will fail as well.

searching using google pointed me to dojo bug tracking and interestingly, it was fixed in 1.8 but since the dojo/text has changed the object from xhr to request, it became an issue again. There used to be a parameter for dojoConfig -> textPluginHeaders that was supposed to resolve this.

But even when I create my own custom/text! object using the previous version of dojo/text, I fail miserably at retrieving the cross-domain resources.

any help would be greatly appreciated.

Upvotes: 0

Views: 577

Answers (2)

bitpshr
bitpshr

Reputation: 1063

The functionality provided by textPluginHeaders was never documented publicly, and as such, was never restored after dojo/text was changed to use dojo/request instead of dojo/xhr. As such, X-Requested-With will just not be sent with dojo/text requests.

See Issue #17493.

Upvotes: 0

mmckenzie
mmckenzie

Reputation: 121

According to ticket 17943 in their bug tracker, this issue was fixed as of Dojo 1.9.4. Have you tried upgrading the framework?

Upvotes: 2

Related Questions