#14482 closed enhancement (fixed)
[patch] [cla] dojo/text without HTTP header "X-Requested-With"
Reported by: | xMartin | Owned by: | Rawld Gill |
---|---|---|---|
Priority: | high | Milestone: | 1.8 |
Component: | Loader | Version: | 1.7.0 |
Keywords: | Cc: | ||
Blocked By: | Blocking: |
Description
dojo.xhr
sends an HTTP header "X-Requested-With: XMLHttpRequest" (#5801) to give servers a hint to send only partial HTML code as it is not a regular page request. Cross-domain xhr causes preflight request with this header (#9486) which can be prevented by setting this header to null
. The loader plugin dojo/text
uses dojo.xhr
to retrieve text files like widget templates. It would be great if this worked cross-domain with CORS headers but it doesn't due to the preflight request.
Would it be reasonable to remove the header in the dojo/text
plugin?
Patch attached, CCLA.
Attachments (1)
Change History (7)
Changed 10 years ago by
Attachment: | requested-with.patch.txt added |
---|
comment:1 Changed 10 years ago by
Summary: | dojo/text without HTTP header "X-Requested-With" → [patch] [cla] dojo/text without HTTP header "X-Requested-With" |
---|
comment:2 Changed 10 years ago by
comment:3 Changed 10 years ago by
Resolution: | → fixed |
---|---|
Status: | new → closed |
comment:4 Changed 10 years ago by
Milestone: | tbd → 1.8 |
---|
comment:5 Changed 10 years ago by
Works for me but in this case needs to be
textPluginHeaders: {"X-Requested-With": null}
comment:6 Changed 9 years ago by
Hey, This broke again when dojo/text.js was updated to use request instead of xhr
Will submit a new regression that references this ticket
Fixed in [27536].
In order to use the feature, set the headers desired for the text plugin like this (e.g.)