Ticket #1619 (closed enhancement: wontfix)
Update XMLHttpRequest generation code
|Reported by:||raziel||Owned by:|
|Keywords:||XMLHttpRequest ActiveX MSXML||Cc:|
The code that creates the XMLHttpREquest, inside the ajax function, should handle different versions of the MSXML ActiveX object. Right now the library uses Microsoft.XMLHTTP which is an old ProdID, just maintained for backwards compatibility.
Then, we should rearrange them to comply with Microsoft's intended use for each one of those version. A greater version number doesn't necessarily mean the most up to date functionality (weird , I know), and moreover, doesn't mean it's the version we should use to generate an XMLHttpRequest object.
Microsoft's preffered version for "web-intended" usage is MSXML2.XMLHTTP.6.0. No surprises there, since it's the latest version. However, the next recommended fall back is not v.5 nor v.4 but v.3.
Now, about the version independent ProdID: MSXML2.XMLHTTP, it's equivalent to MSXML2.XMLHTTP.3.0, given that is the preferred fall back version.
The Microsoft namespace: Microsoft.XMLHTTP is just implemented for legacy support, and only in MSXML v.3.
Whether we should keep the lookup for v.4 and v.5 depends on if we want to at least fall back to something even though it's not designed explicitly to support the web context, or we rather throw an error. I'd rather keep them, and maybe log a warning?
Having said all that, I think there should be an array and iterate over it to generate the XMLHttpRequest instance from the best possible ActiveX.
JSONRpcClient.msxmlNames = [ "MSXML2.XMLHTTP.6.0",
"MSXML2.XMLHTTP.3.0", "MSXML2.XMLHTTP", "MSXML2.XMLHTTP.5.0", "MSXML2.XMLHTTP.4.0", "Microsoft.XMLHTTP" ]; /* this last one could be here or after the version independent id, for efficiency, depending on how true is the claim this is only available in V3 */