Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-cw
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-cw
Commits
be785746
Commit
be785746
authored
Feb 21, 2017
by
Hans Leidekker
Committed by
Alexandre Julliard
Feb 21, 2017
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
winhttp: Cookie attributes are case-insensitive.
Signed-off-by:
Hans Leidekker
<
hans@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
8595cc53
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
62 additions
and
2 deletions
+62
-2
cookie.c
dlls/winhttp/cookie.c
+2
-2
winhttp.c
dlls/winhttp/tests/winhttp.c
+60
-0
No files found.
dlls/winhttp/cookie.c
View file @
be785746
...
...
@@ -256,12 +256,12 @@ BOOL set_cookies( request_t *request, const WCHAR *cookies )
len
=
strlenW
(
p
);
while
(
len
&&
(
attr
=
parse_attr
(
p
,
&
used
)))
{
if
(
!
strcmpW
(
attr
->
name
,
domainW
))
if
(
!
strcmp
i
W
(
attr
->
name
,
domainW
))
{
domain
=
attr
;
cookie_domain
=
attr
->
value
;
}
else
if
(
!
strcmpW
(
attr
->
name
,
pathW
))
else
if
(
!
strcmp
i
W
(
attr
->
name
,
pathW
))
{
path
=
attr
;
cookie_path
=
attr
->
value
;
...
...
dlls/winhttp/tests/winhttp.c
View file @
be785746
...
...
@@ -2011,6 +2011,11 @@ static const char cookiemsg[] =
"Set-Cookie: NAME = value
\r\n
"
"
\r\n
"
;
static
const
char
cookiemsg2
[]
=
"HTTP/1.1 200 OK
\r\n
"
"Set-Cookie: name2=value; Domain = localhost; Path=/cookie5;Expires=Wed, 13 Jan 2021 22:23:01 GMT; HttpOnly;
\r\n
"
"
\r\n
"
;
static
const
char
nocontentmsg
[]
=
"HTTP/1.1 204 No Content
\r\n
"
"Server: winetest
\r\n
"
...
...
@@ -2144,6 +2149,17 @@ static DWORD CALLBACK server_thread(LPVOID param)
send
(
c
,
headmsg
,
sizeof
headmsg
-
1
,
0
);
continue
;
}
if
(
strstr
(
buffer
,
"GET /cookie5"
))
{
if
(
strstr
(
buffer
,
"Cookie: name2=value
\r\n
"
))
send
(
c
,
okmsg
,
sizeof
(
okmsg
)
-
1
,
0
);
else
send
(
c
,
notokmsg
,
sizeof
(
notokmsg
)
-
1
,
0
);
}
if
(
strstr
(
buffer
,
"GET /cookie4"
))
{
send
(
c
,
cookiemsg2
,
sizeof
(
cookiemsg2
)
-
1
,
0
);
}
if
(
strstr
(
buffer
,
"GET /cookie3"
))
{
if
(
strstr
(
buffer
,
"Cookie: name=value2; NAME=value; name=value
\r\n
"
)
||
...
...
@@ -2813,6 +2829,8 @@ static void test_cookies( int port )
static
const
WCHAR
cookieW
[]
=
{
'/'
,
'c'
,
'o'
,
'o'
,
'k'
,
'i'
,
'e'
,
0
};
static
const
WCHAR
cookie2W
[]
=
{
'/'
,
'c'
,
'o'
,
'o'
,
'k'
,
'i'
,
'e'
,
'2'
,
0
};
static
const
WCHAR
cookie3W
[]
=
{
'/'
,
'c'
,
'o'
,
'o'
,
'k'
,
'i'
,
'e'
,
'3'
,
0
};
static
const
WCHAR
cookie4W
[]
=
{
'/'
,
'c'
,
'o'
,
'o'
,
'k'
,
'i'
,
'e'
,
'4'
,
0
};
static
const
WCHAR
cookie5W
[]
=
{
'/'
,
'c'
,
'o'
,
'o'
,
'k'
,
'i'
,
'e'
,
'5'
,
0
};
static
const
WCHAR
cookieheaderW
[]
=
{
'C'
,
'o'
,
'o'
,
'k'
,
'i'
,
'e'
,
':'
,
' '
,
'n'
,
'a'
,
'm'
,
'e'
,
'='
,
'v'
,
'a'
,
'l'
,
'u'
,
'e'
,
'2'
,
'\r'
,
'\n'
,
0
};
HINTERNET
ses
,
con
,
req
;
...
...
@@ -2923,6 +2941,48 @@ static void test_cookies( int port )
WinHttpCloseHandle
(
req
);
WinHttpCloseHandle
(
con
);
WinHttpCloseHandle
(
ses
);
ses
=
WinHttpOpen
(
test_useragent
,
WINHTTP_ACCESS_TYPE_NO_PROXY
,
NULL
,
NULL
,
0
);
ok
(
ses
!=
NULL
,
"failed to open session %u
\n
"
,
GetLastError
()
);
con
=
WinHttpConnect
(
ses
,
localhostW
,
port
,
0
);
ok
(
con
!=
NULL
,
"failed to open a connection %u
\n
"
,
GetLastError
()
);
req
=
WinHttpOpenRequest
(
con
,
NULL
,
cookie4W
,
NULL
,
NULL
,
NULL
,
0
);
ok
(
req
!=
NULL
,
"failed to open a request %u
\n
"
,
GetLastError
()
);
ret
=
WinHttpSendRequest
(
req
,
NULL
,
0
,
NULL
,
0
,
0
,
0
);
ok
(
ret
,
"failed to send request %u
\n
"
,
GetLastError
()
);
ret
=
WinHttpReceiveResponse
(
req
,
NULL
);
ok
(
ret
,
"failed to receive response %u
\n
"
,
GetLastError
()
);
status
=
0xdeadbeef
;
size
=
sizeof
(
status
);
ret
=
WinHttpQueryHeaders
(
req
,
WINHTTP_QUERY_STATUS_CODE
|
WINHTTP_QUERY_FLAG_NUMBER
,
NULL
,
&
status
,
&
size
,
NULL
);
ok
(
ret
,
"failed to query status code %u
\n
"
,
GetLastError
()
);
ok
(
status
==
HTTP_STATUS_OK
,
"request failed unexpectedly %u
\n
"
,
status
);
WinHttpCloseHandle
(
req
);
req
=
WinHttpOpenRequest
(
con
,
NULL
,
cookie5W
,
NULL
,
NULL
,
NULL
,
0
);
ok
(
req
!=
NULL
,
"failed to open a request %u
\n
"
,
GetLastError
()
);
ret
=
WinHttpSendRequest
(
req
,
NULL
,
0
,
NULL
,
0
,
0
,
0
);
ok
(
ret
,
"failed to send request %u
\n
"
,
GetLastError
()
);
ret
=
WinHttpReceiveResponse
(
req
,
NULL
);
ok
(
ret
,
"failed to receive response %u
\n
"
,
GetLastError
()
);
status
=
0xdeadbeef
;
size
=
sizeof
(
status
);
ret
=
WinHttpQueryHeaders
(
req
,
WINHTTP_QUERY_STATUS_CODE
|
WINHTTP_QUERY_FLAG_NUMBER
,
NULL
,
&
status
,
&
size
,
NULL
);
ok
(
ret
,
"failed to query status code %u
\n
"
,
GetLastError
()
);
ok
(
status
==
HTTP_STATUS_OK
||
broken
(
status
==
HTTP_STATUS_BAD_REQUEST
)
/* < win7 */
,
"request failed unexpectedly %u
\n
"
,
status
);
WinHttpCloseHandle
(
req
);
WinHttpCloseHandle
(
con
);
WinHttpCloseHandle
(
ses
);
}
static
void
test_connection_info
(
int
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