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
d6a59f75
Commit
d6a59f75
authored
May 26, 2014
by
Hans Leidekker
Committed by
Alexandre Julliard
May 26, 2014
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wininet: Only set the content length header if it's not explicitly set by the user.
parent
2b76dfba
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
31 additions
and
4 deletions
+31
-4
http.c
dlls/wininet/http.c
+1
-1
http.c
dlls/wininet/tests/http.c
+30
-3
No files found.
dlls/wininet/http.c
View file @
d6a59f75
...
...
@@ -4851,7 +4851,7 @@ static DWORD HTTP_HttpSendRequestW(http_request_t *request, LPCWSTR lpszHeaders,
if
(
dwContentLength
||
strcmpW
(
request
->
verb
,
szGET
))
{
sprintfW
(
contentLengthStr
,
szContentLength
,
dwContentLength
);
HTTP_HttpAddRequestHeadersW
(
request
,
contentLengthStr
,
-
1L
,
HTTP_ADDREQ_FLAG_
REPLACE
);
HTTP_HttpAddRequestHeadersW
(
request
,
contentLengthStr
,
-
1L
,
HTTP_ADDREQ_FLAG_
ADD_IF_NEW
);
request
->
bytesToWrite
=
dwContentLength
;
}
if
(
request
->
session
->
appInfo
->
agent
)
...
...
dlls/wininet/tests/http.c
View file @
d6a59f75
...
...
@@ -2654,10 +2654,10 @@ static void test_header_handling_order(int port)
{
static
const
char
authorization
[]
=
"Authorization: Basic dXNlcjpwd2Q="
;
static
const
char
connection
[]
=
"Connection: Close"
;
static
const
char
*
types
[
2
]
=
{
"*"
,
NULL
};
char
data
[
32
];
HINTERNET
session
,
connect
,
request
;
DWORD
size
,
status
;
DWORD
size
,
status
,
data_len
;
BOOL
ret
;
session
=
InternetOpenA
(
"winetest"
,
INTERNET_OPEN_TYPE_DIRECT
,
NULL
,
NULL
,
0
);
...
...
@@ -2693,6 +2693,10 @@ static void test_header_handling_order(int port)
ok
(
status
==
200
||
status
==
400
/* IE6 */
,
"got status %u, expected 200 or 400
\n
"
,
status
);
InternetCloseHandle
(
request
);
InternetCloseHandle
(
connect
);
connect
=
InternetConnectA
(
session
,
"localhost"
,
port
,
NULL
,
NULL
,
INTERNET_SERVICE_HTTP
,
0
,
0
);
ok
(
connect
!=
NULL
,
"InternetConnect failed
\n
"
);
request
=
HttpOpenRequestA
(
connect
,
"POST"
,
"/test7"
,
NULL
,
NULL
,
types
,
INTERNET_FLAG_KEEP_CONNECTION
,
0
);
ok
(
request
!=
NULL
,
"HttpOpenRequest failed
\n
"
);
...
...
@@ -2707,7 +2711,30 @@ static void test_header_handling_order(int port)
size
=
sizeof
(
status
);
ret
=
HttpQueryInfoA
(
request
,
HTTP_QUERY_STATUS_CODE
|
HTTP_QUERY_FLAG_NUMBER
,
&
status
,
&
size
,
NULL
);
ok
(
ret
,
"HttpQueryInfo failed
\n
"
);
ok
(
status
==
200
||
status
==
400
/* IE6 */
,
"got status %u, expected 200 or 400
\n
"
,
status
);
ok
(
status
==
200
,
"got status %u, expected 200
\n
"
,
status
);
InternetCloseHandle
(
request
);
InternetCloseHandle
(
connect
);
connect
=
InternetConnectA
(
session
,
"localhost"
,
port
,
NULL
,
NULL
,
INTERNET_SERVICE_HTTP
,
0
,
0
);
ok
(
connect
!=
NULL
,
"InternetConnect failed
\n
"
);
request
=
HttpOpenRequestA
(
connect
,
"POST"
,
"/test7b"
,
NULL
,
NULL
,
types
,
0
,
0
);
ok
(
request
!=
NULL
,
"HttpOpenRequest failed
\n
"
);
ret
=
HttpAddRequestHeadersA
(
request
,
"Content-Length: 100
\r\n
"
,
~
0u
,
HTTP_ADDREQ_FLAG_ADD_IF_NEW
);
ok
(
ret
,
"HttpAddRequestHeaders failed
\n
"
);
data_len
=
sizeof
(
data
);
memset
(
data
,
'a'
,
sizeof
(
data
));
ret
=
HttpSendRequestA
(
request
,
connection
,
~
0u
,
data
,
data_len
);
ok
(
ret
,
"HttpSendRequest failed
\n
"
);
status
=
0
;
size
=
sizeof
(
status
);
ret
=
HttpQueryInfoA
(
request
,
HTTP_QUERY_STATUS_CODE
|
HTTP_QUERY_FLAG_NUMBER
,
&
status
,
&
size
,
NULL
);
ok
(
ret
,
"HttpQueryInfo failed
\n
"
);
ok
(
status
==
200
,
"got status %u, expected 200
\n
"
,
status
);
InternetCloseHandle
(
request
);
InternetCloseHandle
(
connect
);
...
...
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