json - JavaScript - XMLHttpRequest overrideMimeType in IE -
take code:
let jsonrequest = new xmlhttprequest(); jsonrequest.overridemimetype("application/json"); jsonrequest.open('get', './js/settings.json', true);
ie doesn't support overridemimetype
, , html has been set utf-8
. there risk leaving overridemimetype
line out? seems work fine without it. this question has pretty same issue, answer isn't clear.
ie started supporting mime-type overriding v11. never necessary in practice, discussed on other post you've linked.
from security point, concerned - answer no. not using can't impose security issue, using alone won't make better secure.
if you're concerned response validity, example - if it's valid json before parsing , using, there better choice of using getresponseheader method, facilitate aborting request in case of invalid header headers arrived; see https://developer.mozilla.org/en-us/docs/web/api/xmlhttprequest/getresponseheader
Comments
Post a Comment