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
8966cfe4
Commit
8966cfe4
authored
Sep 26, 2007
by
Jacek Caban
Committed by
Alexandre Julliard
Sep 27, 2007
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
mshtml: Ignore app's User-Agent header and Content-Type if there is no data to post.
parent
e27f1854
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
53 additions
and
1 deletion
+53
-1
persist.c
dlls/mshtml/persist.c
+53
-1
No files found.
dlls/mshtml/persist.c
View file @
8966cfe4
...
...
@@ -39,6 +39,54 @@
WINE_DEFAULT_DEBUG_CHANNEL
(
mshtml
);
#define USER_AGENT "User-Agent:"
#define CONTENT_TYPE "Content-Type:"
static
int
fix_headers
(
char
*
buf
,
DWORD
post_len
)
{
char
*
ptr
=
NULL
;
if
(
!
strncasecmp
(
USER_AGENT
,
buf
,
sizeof
(
USER_AGENT
)
-
1
))
{
ptr
=
buf
;
}
else
{
ptr
=
strstr
(
buf
,
"
\r\n
"
USER_AGENT
);
if
(
ptr
)
ptr
+=
2
;
}
if
(
ptr
)
{
const
char
*
ptr2
;
FIXME
(
"Ignoring User-Agent header
\n
"
);
ptr2
=
strstr
(
ptr
,
"
\r\n
"
);
if
(
ptr2
)
memmove
(
ptr
,
ptr2
,
strlen
(
ptr2
)
+
1
);
}
if
(
!
post_len
)
{
if
(
!
strncasecmp
(
CONTENT_TYPE
,
buf
,
sizeof
(
CONTENT_TYPE
)
-
1
))
{
ptr
=
buf
;
}
else
{
ptr
=
strstr
(
buf
,
"
\r\n
"
CONTENT_TYPE
);
if
(
ptr
)
ptr
+=
2
;
}
if
(
ptr
)
{
const
char
*
ptr2
;
TRACE
(
"Ignoring Content-Type header
\n
"
);
ptr2
=
strstr
(
ptr
,
"
\r\n
"
);
if
(
ptr2
)
memmove
(
ptr
,
ptr2
,
strlen
(
ptr2
)
+
1
);
}
}
return
strlen
(
buf
);
}
static
nsIInputStream
*
get_post_data_stream
(
IBindCtx
*
bctx
)
{
nsIInputStream
*
ret
=
NULL
;
...
...
@@ -84,7 +132,7 @@ static nsIInputStream *get_post_data_stream(IBindCtx *bctx)
post_len
=
bindinfo
.
cbstgmedData
;
if
(
headers_len
||
post_len
)
{
int
len
=
headers_len
?
headers_len
-
1
:
0
;
int
len
=
0
;
static
const
char
content_length
[]
=
"Content-Length: %u
\r\n\r\n
"
;
...
...
@@ -93,9 +141,13 @@ static nsIInputStream *get_post_data_stream(IBindCtx *bctx)
if
(
headers_len
)
{
WideCharToMultiByte
(
CP_ACP
,
0
,
headers
,
-
1
,
data
,
-
1
,
NULL
,
NULL
);
CoTaskMemFree
(
headers
);
len
=
fix_headers
(
data
,
post_len
);
}
if
(
post_len
)
{
if
(
len
>=
4
&&
!
strcmp
(
data
+
len
-
4
,
"
\r\n\r\n
"
))
len
-=
2
;
sprintf
(
data
+
len
,
content_length
,
post_len
);
len
=
strlen
(
data
);
...
...
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