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
06e8d06b
Commit
06e8d06b
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: Respect LOAD_CALL_CONTENT_SNIFFERS when using detected mime type.
Signed-off-by:
Gabriel Ivăncescu
<
gabrielopcode@gmail.com
>
parent
59f1fdaf
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
26 additions
and
3 deletions
+26
-3
navigate.c
dlls/mshtml/navigate.c
+2
-1
events.js
dlls/mshtml/tests/events.js
+10
-0
img.png
dlls/mshtml/tests/img.png
+0
-0
rsrc.rc
dlls/mshtml/tests/rsrc.rc
+3
-0
script.c
dlls/mshtml/tests/script.c
+11
-2
No files found.
dlls/mshtml/navigate.c
View file @
06e8d06b
...
...
@@ -1670,7 +1670,8 @@ static HRESULT nsChannelBSC_on_progress(BSCallback *bsc, ULONG status_code, LPCW
This
->
nschannel
=
NULL
;
}
if
(
!
This
->
nschannel
)
if
(
!
This
->
nschannel
||
(
This
->
nschannel
->
content_type
&&
!
(
This
->
nschannel
->
load_flags
&
LOAD_CALL_CONTENT_SNIFFERS
)))
return
S_OK
;
heap_free
(
This
->
nschannel
->
content_type
);
...
...
dlls/mshtml/tests/events.js
View file @
06e8d06b
...
...
@@ -797,6 +797,16 @@ async_test("detached_img_error_event", function() {
img
.
src
=
"about:blank"
;
});
async_test
(
"img_wrong_content_type"
,
function
()
{
var
img
=
new
Image
();
img
.
onload
=
function
()
{
ok
(
img
.
width
===
2
,
"width = "
+
img
.
width
);
ok
(
img
.
height
===
2
,
"height = "
+
img
.
height
);
next_test
();
}
img
.
src
=
"img.png?content-type=image/jpeg"
;
});
async_test
(
"message event"
,
function
()
{
var
listener_called
=
false
;
...
...
dlls/mshtml/tests/img.png
0 → 100644
View file @
06e8d06b
74 Bytes
dlls/mshtml/tests/rsrc.rc
View file @
06e8d06b
...
...
@@ -80,3 +80,6 @@ res.html test "jstest.html"
/* @makedep: jstest.html */
dir/dir2/res.html test "jstest.html"
/* @makedep: img.png */
img.png PNG "img.png"
dlls/mshtml/tests/script.c
View file @
06e8d06b
...
...
@@ -3043,6 +3043,7 @@ typedef struct {
IInternetProtocolSink
*
sink
;
BINDINFO
bind_info
;
BSTR
content_type
;
IStream
*
stream
;
char
*
data
;
ULONG
size
;
...
...
@@ -3068,6 +3069,7 @@ static void report_data(ProtocolHandler *This)
IServiceProvider
*
service_provider
;
IHttpNegotiate
*
http_negotiate
;
WCHAR
*
addl_headers
=
NULL
;
WCHAR
headers_buf
[
128
];
BSTR
headers
,
url
;
HRESULT
hres
;
...
...
@@ -3091,7 +3093,10 @@ static void report_data(ProtocolHandler *This)
CoTaskMemFree
(
addl_headers
);
headers
=
SysAllocString
(
L"HTTP/1.1 200 OK
\r\n\r\n
"
);
if
(
This
->
content_type
)
swprintf
(
headers_buf
,
ARRAY_SIZE
(
headers_buf
),
L"HTTP/1.1 200 OK
\r\n
Content-Type: %s
\r\n
"
,
This
->
content_type
);
headers
=
SysAllocString
(
This
->
content_type
?
headers_buf
:
L"HTTP/1.1 200 OK
\r\n\r\n
"
);
hres
=
IHttpNegotiate_OnResponse
(
http_negotiate
,
200
,
headers
,
NULL
,
NULL
);
ok
(
hres
==
S_OK
,
"OnResponse failed: %08lx
\n
"
,
hres
);
SysFreeString
(
headers
);
...
...
@@ -3250,6 +3255,7 @@ static ULONG WINAPI Protocol_Release(IInternetProtocolEx *iface)
if
(
This
->
uri
)
IUri_Release
(
This
->
uri
);
ReleaseBindInfo
(
&
This
->
bind_info
);
SysFreeString
(
This
->
content_type
);
HeapFree
(
GetProcessHeap
(),
0
,
This
);
}
...
...
@@ -3397,7 +3403,8 @@ static HRESULT WINAPI ProtocolEx_StartEx(IInternetProtocolEx *iface, IUri *uri,
This
->
data
=
empty_data
;
This
->
size
=
strlen
(
This
->
data
);
}
else
{
src
=
FindResourceW
(
NULL
,
*
path
==
'/'
?
path
+
1
:
path
,
(
const
WCHAR
*
)
RT_HTML
);
const
WCHAR
*
type
=
(
SysStringLen
(
path
)
>
4
&&
!
wcsicmp
(
path
+
SysStringLen
(
path
)
-
4
,
L".png"
))
?
L"PNG"
:
(
const
WCHAR
*
)
RT_HTML
;
src
=
FindResourceW
(
NULL
,
*
path
==
'/'
?
path
+
1
:
path
,
type
);
if
(
src
)
{
This
->
size
=
SizeofResource
(
NULL
,
src
);
This
->
data
=
LoadResource
(
NULL
,
src
);
...
...
@@ -3424,6 +3431,8 @@ static HRESULT WINAPI ProtocolEx_StartEx(IInternetProtocolEx *iface, IUri *uri,
if
(
SUCCEEDED
(
hres
))
{
if
(
!
lstrcmpW
(
query
,
L"?delay"
))
This
->
delay
=
1000
;
else
if
(
!
wcsncmp
(
query
,
L"?content-type="
,
sizeof
(
"?content-type="
)
-
1
))
This
->
content_type
=
SysAllocString
(
query
+
sizeof
(
"?content-type="
)
-
1
);
SysFreeString
(
query
);
}
...
...
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