Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-winehq
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wine
wine-winehq
Commits
764c1bdb
Commit
764c1bdb
authored
Jul 13, 2022
by
Gabriel Ivăncescu
Committed by
Alexandre Julliard
Jul 13, 2022
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
mshtml: Check for valid XML Content-Type for responseXML in IE10+ modes.
Signed-off-by:
Gabriel Ivăncescu
<
gabrielopcode@gmail.com
>
parent
06e8d06b
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
69 additions
and
2 deletions
+69
-2
xhr.js
dlls/mshtml/tests/xhr.js
+55
-2
xmlhttprequest.c
dlls/mshtml/xmlhttprequest.c
+14
-0
No files found.
dlls/mshtml/tests/xhr.js
View file @
764c1bdb
...
...
@@ -16,6 +16,8 @@
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/
var
xml
=
"<?xml version=
\"
1.0
\"
encoding=
\"
UTF-8
\"
?>
\
n<a name=
\"
test
\"
>wine</a>"
;
function
test_xhr
()
{
var
xhr
=
new
XMLHttpRequest
();
var
complete_cnt
=
0
,
loadstart
=
false
;
...
...
@@ -24,7 +26,9 @@ function test_xhr() {
if
(
xhr
.
readyState
!=
4
)
return
;
ok
(
xhr
.
responseText
===
"Testing..."
,
"unexpected responseText "
+
xhr
.
responseText
);
ok
(
xhr
.
responseText
===
xml
,
"unexpected responseText "
+
xhr
.
responseText
);
ok
(
xhr
.
responseXML
!==
null
,
"unexpected null responseXML"
);
if
(
complete_cnt
++
&&
!
(
"onloadend"
in
xhr
))
next_test
();
}
...
...
@@ -63,7 +67,55 @@ function test_xhr() {
ok
(
xhr
.
withCredentials
===
true
,
"withCredentials = "
+
xhr
.
withCredentials
);
xhr
.
withCredentials
=
false
;
}
xhr
.
send
(
"Testing..."
);
xhr
.
send
(
xml
);
}
function
test_content_types
()
{
var
xhr
=
new
XMLHttpRequest
(),
types
,
i
=
0
;
var
v
=
document
.
documentMode
;
var
types
=
[
""
,
"text/plain"
,
"text/html"
,
"wine/xml"
,
"xml"
];
var
xml_types
=
[
"text/xmL"
,
"apPliCation/xml"
,
"image/SvG+xml"
,
"Wine/Test+xml"
,
"++Xml"
,
"+xMl"
];
function
onload
()
{
ok
(
xhr
.
responseText
===
xml
,
"unexpected responseText "
+
xhr
.
responseText
);
if
(
v
<
10
||
types
===
xml_types
)
ok
(
xhr
.
responseXML
!==
null
,
"unexpected null responseXML for "
+
types
[
i
]);
else
ok
(
xhr
.
responseXML
===
null
,
"unexpected non-null responseXML for "
+
types
[
i
]);
if
(
++
i
>=
types
.
length
)
{
if
(
types
===
xml_types
)
{
next_test
();
return
;
}
types
=
xml_types
;
i
=
0
;
}
xhr
=
new
XMLHttpRequest
();
xhr
.
onload
=
onload
;
xhr
.
open
(
"POST"
,
"echo.php?content-type="
+
types
[
i
],
true
);
xhr
.
setRequestHeader
(
"X-Test"
,
"True"
);
xhr
.
send
(
xml
);
}
xhr
.
onload
=
onload
;
xhr
.
open
(
"POST"
,
"echo.php?content-type="
+
types
[
i
],
true
);
xhr
.
setRequestHeader
(
"X-Test"
,
"True"
);
xhr
.
send
(
xml
);
}
function
test_abort
()
{
...
...
@@ -118,6 +170,7 @@ function test_timeout() {
var
tests
=
[
test_xhr
,
test_content_types
,
test_abort
,
test_timeout
];
dlls/mshtml/xmlhttprequest.c
View file @
764c1bdb
...
...
@@ -374,6 +374,20 @@ static HRESULT WINAPI HTMLXMLHttpRequest_get_responseXML(IHTMLXMLHttpRequest *if
TRACE
(
"(%p)->(%p)
\n
"
,
This
,
p
);
if
(
dispex_compat_mode
(
&
This
->
event_target
.
dispex
)
>=
COMPAT_MODE_IE10
)
{
nsIDOMDocument
*
nsdoc
;
nsresult
nsres
;
nsres
=
nsIXMLHttpRequest_GetResponseXML
(
This
->
nsxhr
,
&
nsdoc
);
if
(
NS_FAILED
(
nsres
))
return
map_nsresult
(
nsres
);
if
(
!
nsdoc
)
{
*
p
=
NULL
;
return
S_OK
;
}
nsIDOMDocument_Release
(
nsdoc
);
}
hres
=
CoCreateInstance
(
&
CLSID_DOMDocument
,
NULL
,
CLSCTX_INPROC_SERVER
,
&
IID_IXMLDOMDocument
,
(
void
**
)
&
xmldoc
);
if
(
FAILED
(
hres
))
{
ERR
(
"CoCreateInstance failed: %08lx
\n
"
,
hres
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment