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
3b8d9ac3
Commit
3b8d9ac3
authored
Apr 15, 2022
by
Ziqing Hui
Committed by
Alexandre Julliard
May 04, 2022
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wininet/tests: Test adding empty HTTP header.
Signed-off-by:
Ziqing Hui
<
zhui@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
dc37b66d
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
26 additions
and
0 deletions
+26
-0
http.c
dlls/wininet/tests/http.c
+26
-0
No files found.
dlls/wininet/tests/http.c
View file @
3b8d9ac3
...
...
@@ -2063,6 +2063,32 @@ static void HttpHeaders_test(void)
"header still present
\n
"
);
ok
(
GetLastError
()
==
ERROR_HTTP_HEADER_NOT_FOUND
,
"got %lu
\n
"
,
GetLastError
());
/* Header with empty value should cause a failure */
todo_wine
{
SetLastError
(
0xdeadbeef
);
ok
(
!
HttpAddRequestHeadersA
(
hRequest
,
"EmptyTest1:"
,
-
1
,
HTTP_ADDREQ_FLAG_ADD
),
"Empty header should not be added.
\n
"
);
ok
(
GetLastError
()
==
ERROR_INVALID_PARAMETER
,
"Got unexpected error code %lu.
\n
"
,
GetLastError
());
SetLastError
(
0xdeadbeef
);
ok
(
!
HttpAddRequestHeadersA
(
hRequest
,
"EmptyTest2:
\r\n
"
,
-
1
,
HTTP_ADDREQ_FLAG_ADD
),
"Empty header should not be added.
\n
"
);
ok
(
GetLastError
()
==
ERROR_INVALID_PARAMETER
,
"Got unexpected error code %lu.
\n
"
,
GetLastError
());
len
=
sizeof
(
buffer
);
strcpy
(
buffer
,
"EmptyTest1"
);
SetLastError
(
0xdeadbeef
);
ok
(
!
HttpQueryInfoA
(
hRequest
,
HTTP_QUERY_CUSTOM
|
HTTP_QUERY_FLAG_REQUEST_HEADERS
,
buffer
,
&
len
,
NULL
),
"Header with empty value is present.
\n
"
);
ok
(
GetLastError
()
==
ERROR_HTTP_HEADER_NOT_FOUND
,
"Got unexpected error code %lu.
\n
"
,
GetLastError
());
len
=
sizeof
(
buffer
);
strcpy
(
buffer
,
"EmptyTest2"
);
SetLastError
(
0xdeadbeef
);
ok
(
!
HttpQueryInfoA
(
hRequest
,
HTTP_QUERY_CUSTOM
|
HTTP_QUERY_FLAG_REQUEST_HEADERS
,
buffer
,
&
len
,
NULL
),
"Header with empty value is present.
\n
"
);
ok
(
GetLastError
()
==
ERROR_HTTP_HEADER_NOT_FOUND
,
"Got unexpected error code %lu.
\n
"
,
GetLastError
());
}
ok
(
InternetCloseHandle
(
hRequest
),
"Close request handle failed
\n
"
);
done:
ok
(
InternetCloseHandle
(
hConnect
),
"Close connect handle failed
\n
"
);
...
...
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