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
b191a4e1
Commit
b191a4e1
authored
May 16, 2015
by
Michael Müller
Committed by
Vitaly Lipatov
Jul 30, 2022
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wininet: Strip filename if no path is set in cookie.
The order of the stored cookies doesn't match in /testC, so be a bit less strict in the test.
parent
547d00b2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
13 additions
and
4 deletions
+13
-4
http.c
dlls/wininet/http.c
+10
-1
http.c
dlls/wininet/tests/http.c
+3
-3
No files found.
dlls/wininet/http.c
View file @
b191a4e1
...
@@ -652,10 +652,18 @@ static void HTTP_ProcessCookies( http_request_t *request )
...
@@ -652,10 +652,18 @@ static void HTTP_ProcessCookies( http_request_t *request )
int
HeaderIndex
;
int
HeaderIndex
;
int
numCookies
=
0
;
int
numCookies
=
0
;
LPHTTPHEADERW
setCookieHeader
;
LPHTTPHEADERW
setCookieHeader
;
WCHAR
*
path
,
*
tmp
;
if
(
request
->
hdr
.
dwFlags
&
INTERNET_FLAG_NO_COOKIES
)
if
(
request
->
hdr
.
dwFlags
&
INTERNET_FLAG_NO_COOKIES
)
return
;
return
;
path
=
heap_strdupW
(
request
->
path
);
if
(
!
path
)
return
;
tmp
=
wcsrchr
(
path
,
'/'
);
if
(
tmp
&&
tmp
[
1
])
tmp
[
1
]
=
0
;
EnterCriticalSection
(
&
request
->
headers_section
);
EnterCriticalSection
(
&
request
->
headers_section
);
while
((
HeaderIndex
=
HTTP_GetCustomHeaderIndex
(
request
,
L"Set-Cookie"
,
numCookies
++
,
FALSE
))
!=
-
1
)
while
((
HeaderIndex
=
HTTP_GetCustomHeaderIndex
(
request
,
L"Set-Cookie"
,
numCookies
++
,
FALSE
))
!=
-
1
)
...
@@ -674,10 +682,11 @@ static void HTTP_ProcessCookies( http_request_t *request )
...
@@ -674,10 +682,11 @@ static void HTTP_ProcessCookies( http_request_t *request )
name
=
substr
(
setCookieHeader
->
lpszValue
,
data
-
setCookieHeader
->
lpszValue
);
name
=
substr
(
setCookieHeader
->
lpszValue
,
data
-
setCookieHeader
->
lpszValue
);
data
++
;
data
++
;
set_cookie
(
substrz
(
request
->
server
->
name
),
substrz
(
request
->
path
),
name
,
substrz
(
data
),
INTERNET_COOKIE_HTTPONLY
);
set_cookie
(
substrz
(
request
->
server
->
name
),
substrz
(
path
),
name
,
substrz
(
data
),
INTERNET_COOKIE_HTTPONLY
);
}
}
LeaveCriticalSection
(
&
request
->
headers_section
);
LeaveCriticalSection
(
&
request
->
headers_section
);
heap_free
(
path
);
}
}
static
void
strip_spaces
(
LPWSTR
start
)
static
void
strip_spaces
(
LPWSTR
start
)
...
...
dlls/wininet/tests/http.c
View file @
b191a4e1
...
@@ -2365,7 +2365,7 @@ static DWORD CALLBACK server_thread(LPVOID param)
...
@@ -2365,7 +2365,7 @@ static DWORD CALLBACK server_thread(LPVOID param)
}
}
if
(
strstr
(
buffer
,
"/testC"
))
if
(
strstr
(
buffer
,
"/testC"
))
{
{
if
(
strstr
(
buffer
,
"
Cookie:
cookie=biscuit"
))
if
(
strstr
(
buffer
,
"cookie=biscuit"
))
send
(
c
,
okmsg
,
sizeof
okmsg
-
1
,
0
);
send
(
c
,
okmsg
,
sizeof
okmsg
-
1
,
0
);
else
else
send
(
c
,
notokmsg
,
sizeof
notokmsg
-
1
,
0
);
send
(
c
,
notokmsg
,
sizeof
notokmsg
-
1
,
0
);
...
@@ -3393,7 +3393,7 @@ static void test_header_override(int port)
...
@@ -3393,7 +3393,7 @@ static void test_header_override(int port)
ret
=
HttpSendRequestA
(
req
,
NULL
,
0
,
NULL
,
0
);
ret
=
HttpSendRequestA
(
req
,
NULL
,
0
,
NULL
,
0
);
ok
(
ret
,
"HttpSendRequest failed
\n
"
);
ok
(
ret
,
"HttpSendRequest failed
\n
"
);
test_status_code
_todo
(
req
,
200
);
test_status_code
(
req
,
200
);
InternetCloseHandle
(
req
);
InternetCloseHandle
(
req
);
req
=
HttpOpenRequestA
(
con
,
NULL
,
"/test_cookie_check_host_override"
,
NULL
,
NULL
,
NULL
,
INTERNET_FLAG_KEEP_CONNECTION
,
0
);
req
=
HttpOpenRequestA
(
con
,
NULL
,
"/test_cookie_check_host_override"
,
NULL
,
NULL
,
NULL
,
INTERNET_FLAG_KEEP_CONNECTION
,
0
);
...
@@ -3402,7 +3402,7 @@ static void test_header_override(int port)
...
@@ -3402,7 +3402,7 @@ static void test_header_override(int port)
ret
=
HttpSendRequestA
(
req
,
NULL
,
0
,
NULL
,
0
);
ret
=
HttpSendRequestA
(
req
,
NULL
,
0
,
NULL
,
0
);
ok
(
ret
,
"HttpSendRequest failed
\n
"
);
ok
(
ret
,
"HttpSendRequest failed
\n
"
);
test_status_code
_todo
(
req
,
200
);
test_status_code
(
req
,
200
);
InternetCloseHandle
(
req
);
InternetCloseHandle
(
req
);
InternetSetCookieA
(
"http://test.local"
,
"foo"
,
"bar"
);
InternetSetCookieA
(
"http://test.local"
,
"foo"
,
"bar"
);
...
...
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