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
a8c1d5c1
Commit
a8c1d5c1
authored
Nov 14, 2022
by
Paul Gofman
Committed by
Alexandre Julliard
Nov 14, 2022
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
winhttp: Always send Content-length with PUT.
parent
cc0f4430
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
16 additions
and
5 deletions
+16
-5
request.c
dlls/winhttp/request.c
+1
-1
winhttp.c
dlls/winhttp/tests/winhttp.c
+15
-4
No files found.
dlls/winhttp/request.c
View file @
a8c1d5c1
...
...
@@ -2185,7 +2185,7 @@ static DWORD send_request( struct request *request, const WCHAR *headers, DWORD
if
(
request
->
creds
[
TARGET_SERVER
][
SCHEME_BASIC
].
username
)
do_authorization
(
request
,
WINHTTP_AUTH_TARGET_SERVER
,
WINHTTP_AUTH_SCHEME_BASIC
);
if
(
total_len
||
(
request
->
verb
&&
!
wcscmp
(
request
->
verb
,
L"POST"
)))
if
(
total_len
||
(
request
->
verb
&&
(
!
wcscmp
(
request
->
verb
,
L"POST"
)
||
!
wcscmp
(
request
->
verb
,
L"PUT"
)
)))
{
WCHAR
length
[
21
];
/* decimal long int + null */
swprintf
(
length
,
ARRAY_SIZE
(
length
),
L"%ld"
,
total_len
);
...
...
dlls/winhttp/tests/winhttp.c
View file @
a8c1d5c1
...
...
@@ -2541,6 +2541,11 @@ static DWORD CALLBACK server_thread(LPVOID param)
ok
(
!!
strstr
(
buffer
,
"Cookie: 111
\r\n
"
),
"Header missing from request %s.
\n
"
,
debugstr_a
(
buffer
));
send
(
c
,
okmsg
,
sizeof
(
okmsg
)
-
1
,
0
);
}
if
(
strstr
(
buffer
,
"PUT /test"
))
{
ok
(
!!
strstr
(
buffer
,
"Content-Length: 0
\r\n
"
),
"Header missing from request %s.
\n
"
,
debugstr_a
(
buffer
));
send
(
c
,
okmsg
,
sizeof
(
okmsg
)
-
1
,
0
);
}
shutdown
(
c
,
2
);
closesocket
(
c
);
c
=
-
1
;
...
...
@@ -2633,8 +2638,15 @@ static void test_basic_request(int port, const WCHAR *verb, const WCHAR *path)
memset
(
buffer
,
0
,
sizeof
(
buffer
));
ret
=
WinHttpReadData
(
req
,
buffer
,
sizeof
buffer
,
&
count
);
ok
(
ret
,
"failed to read data %lu
\n
"
,
GetLastError
());
ok
(
count
==
sizeof
page1
-
1
,
"count was wrong
\n
"
);
ok
(
!
memcmp
(
buffer
,
page1
,
sizeof
page1
),
"http data wrong
\n
"
);
if
(
verb
&&
!
wcscmp
(
verb
,
L"PUT"
))
{
ok
(
!
count
,
"got count %ld
\n
"
,
count
);
}
else
{
ok
(
count
==
sizeof
page1
-
1
,
"got count %ld
\n
"
,
count
);
ok
(
!
memcmp
(
buffer
,
page1
,
sizeof
page1
),
"http data wrong
\n
"
);
}
WinHttpCloseHandle
(
req
);
WinHttpCloseHandle
(
con
);
...
...
@@ -5795,7 +5807,6 @@ START_TEST (winhttp)
test_WinHttpGetProxyForUrl
();
test_chunked_read
();
test_max_http_automatic_redirects
();
si
.
event
=
CreateEventW
(
NULL
,
0
,
0
,
NULL
);
si
.
port
=
7532
;
...
...
@@ -5809,10 +5820,10 @@ START_TEST (winhttp)
CloseHandle
(
thread
);
return
;
}
test_IWinHttpRequest
(
si
.
port
);
test_connection_info
(
si
.
port
);
test_basic_request
(
si
.
port
,
NULL
,
L"/basic"
);
test_basic_request
(
si
.
port
,
L"PUT"
,
L"/test"
);
test_no_headers
(
si
.
port
);
test_no_content
(
si
.
port
);
test_head_request
(
si
.
port
);
...
...
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