Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-fonts
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
Aleksandr Isakov
wine-fonts
Commits
547d00b2
Commit
547d00b2
authored
May 15, 2015
by
Michael Müller
Committed by
Vitaly Lipatov
Jul 30, 2022
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wininet/tests: Check cookie behaviour when overriding host.
parent
20a7b515
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
95 additions
and
0 deletions
+95
-0
http.c
dlls/wininet/tests/http.c
+95
-0
No files found.
dlls/wininet/tests/http.c
View file @
547d00b2
...
...
@@ -2139,6 +2139,14 @@ static const char okmsg_cookie_path[] =
"Set-Cookie: subcookie2=data; path=/test_cookie_set_path
\r\n
"
"
\r\n
"
;
static
const
char
okmsg_cookie
[]
=
"HTTP/1.1 200 OK
\r\n
"
"Date: Mon, 01 Dec 2008 13:44:34 GMT
\r\n
"
"Server: winetest
\r\n
"
"Content-Length: 0
\r\n
"
"Set-Cookie: testcookie=testvalue
\r\n
"
"
\r\n
"
;
static
const
char
notokmsg
[]
=
"HTTP/1.1 400 Bad Request
\r\n
"
"Server: winetest
\r\n
"
...
...
@@ -2584,6 +2592,25 @@ static DWORD CALLBACK server_thread(LPVOID param)
else
send
(
c
,
notokmsg
,
sizeof
notokmsg
-
1
,
0
);
}
if
(
strstr
(
buffer
,
"/test_cookie_set_host_override"
))
{
send
(
c
,
okmsg_cookie
,
sizeof
okmsg_cookie
-
1
,
0
);
}
if
(
strstr
(
buffer
,
"/test_cookie_check_host_override"
))
{
if
(
strstr
(
buffer
,
"Cookie:"
)
&&
strstr
(
buffer
,
"testcookie=testvalue"
))
send
(
c
,
okmsg
,
sizeof
okmsg
-
1
,
0
);
else
send
(
c
,
notokmsg
,
sizeof
notokmsg
-
1
,
0
);
}
if
(
strstr
(
buffer
,
"/test_cookie_check_different_host"
))
{
if
(
!
strstr
(
buffer
,
"foo"
)
&&
strstr
(
buffer
,
"cookie=biscuit"
))
send
(
c
,
okmsg
,
sizeof
okmsg
-
1
,
0
);
else
send
(
c
,
notokmsg
,
sizeof
notokmsg
-
1
,
0
);
}
if
(
strstr
(
buffer
,
"/test_host_override"
))
{
if
(
strstr
(
buffer
,
host_header_override
))
...
...
@@ -3332,6 +3359,74 @@ static void test_header_override(int port)
}
InternetCloseHandle
(
req
);
InternetSetCookieA
(
"http://localhost"
,
"cookie"
,
"biscuit"
);
req
=
HttpOpenRequestA
(
con
,
NULL
,
"/testC"
,
NULL
,
NULL
,
NULL
,
INTERNET_FLAG_KEEP_CONNECTION
,
0
);
ok
(
req
!=
NULL
,
"HttpOpenRequest failed
\n
"
);
ret
=
HttpAddRequestHeadersA
(
req
,
host_header_override
,
~
0u
,
HTTP_ADDREQ_FLAG_ADD
);
ok
(
ret
,
"HttpAddRequestHeaders failed
\n
"
);
ret
=
HttpSendRequestA
(
req
,
NULL
,
0
,
NULL
,
0
);
ok
(
ret
,
"HttpSendRequest failed
\n
"
);
test_status_code
(
req
,
200
);
InternetCloseHandle
(
req
);
req
=
HttpOpenRequestA
(
con
,
NULL
,
"/test_cookie_set_host_override"
,
NULL
,
NULL
,
NULL
,
INTERNET_FLAG_KEEP_CONNECTION
,
0
);
ok
(
req
!=
NULL
,
"HttpOpenRequest failed
\n
"
);
ret
=
HttpAddRequestHeadersA
(
req
,
host_header_override
,
~
0u
,
HTTP_ADDREQ_FLAG_ADD
);
ok
(
ret
,
"HttpAddRequestHeaders failed
\n
"
);
ret
=
HttpSendRequestA
(
req
,
NULL
,
0
,
NULL
,
0
);
ok
(
ret
,
"HttpSendRequest failed
\n
"
);
test_status_code
(
req
,
200
);
InternetCloseHandle
(
req
);
req
=
HttpOpenRequestA
(
con
,
NULL
,
"/test_cookie_check_host_override"
,
NULL
,
NULL
,
NULL
,
INTERNET_FLAG_KEEP_CONNECTION
,
0
);
ok
(
req
!=
NULL
,
"HttpOpenRequest failed
\n
"
);
ret
=
HttpAddRequestHeadersA
(
req
,
host_header_override
,
~
0u
,
HTTP_ADDREQ_FLAG_ADD
);
ok
(
ret
,
"HttpAddRequestHeaders failed
\n
"
);
ret
=
HttpSendRequestA
(
req
,
NULL
,
0
,
NULL
,
0
);
ok
(
ret
,
"HttpSendRequest failed
\n
"
);
test_status_code_todo
(
req
,
200
);
InternetCloseHandle
(
req
);
req
=
HttpOpenRequestA
(
con
,
NULL
,
"/test_cookie_check_host_override"
,
NULL
,
NULL
,
NULL
,
INTERNET_FLAG_KEEP_CONNECTION
,
0
);
ok
(
req
!=
NULL
,
"HttpOpenRequest failed
\n
"
);
ret
=
HttpSendRequestA
(
req
,
NULL
,
0
,
NULL
,
0
);
ok
(
ret
,
"HttpSendRequest failed
\n
"
);
test_status_code_todo
(
req
,
200
);
InternetCloseHandle
(
req
);
InternetSetCookieA
(
"http://test.local"
,
"foo"
,
"bar"
);
req
=
HttpOpenRequestA
(
con
,
NULL
,
"/test_cookie_check_different_host"
,
NULL
,
NULL
,
NULL
,
INTERNET_FLAG_KEEP_CONNECTION
,
0
);
ok
(
req
!=
NULL
,
"HttpOpenRequest failed
\n
"
);
ret
=
HttpSendRequestA
(
req
,
NULL
,
0
,
NULL
,
0
);
ok
(
ret
,
"HttpSendRequest failed
\n
"
);
test_status_code
(
req
,
200
);
InternetCloseHandle
(
req
);
req
=
HttpOpenRequestA
(
con
,
NULL
,
"/test_cookie_check_different_host"
,
NULL
,
NULL
,
NULL
,
INTERNET_FLAG_KEEP_CONNECTION
,
0
);
ok
(
req
!=
NULL
,
"HttpOpenRequest failed
\n
"
);
ret
=
HttpAddRequestHeadersA
(
req
,
host_header_override
,
~
0u
,
HTTP_ADDREQ_FLAG_ADD
);
ok
(
ret
,
"HttpAddRequestHeaders failed
\n
"
);
ret
=
HttpSendRequestA
(
req
,
NULL
,
0
,
NULL
,
0
);
ok
(
ret
,
"HttpSendRequest failed
\n
"
);
test_status_code
(
req
,
200
);
InternetCloseHandle
(
req
);
InternetCloseHandle
(
con
);
InternetCloseHandle
(
ses
);
...
...
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