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
9e68c651
Commit
9e68c651
authored
Nov 22, 2005
by
Aric Stewart
Committed by
Alexandre Julliard
Nov 22, 2005
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix some logic to allow HTTP_ADDREQ_FLAG_ADD to replace existing
headers. Also adding a test for some header adding flags.
parent
7f9e281b
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
34 additions
and
2 deletions
+34
-2
http.c
dlls/wininet/http.c
+4
-2
http.c
dlls/wininet/tests/http.c
+30
-0
No files found.
dlls/wininet/http.c
View file @
9e68c651
...
...
@@ -2692,7 +2692,8 @@ static BOOL HTTP_ProcessHeader(LPWININETHTTPREQW lpwhr, LPCWSTR field, LPCWSTR v
else
lphttpHdr
->
wFlags
&=
~
HDR_ISREQUEST
;
if
(
!
lphttpHdr
->
lpszValue
&&
(
dwModifier
&
(
HTTP_ADDHDR_FLAG_ADD
|
HTTP_ADDHDR_FLAG_ADD_IF_NEW
)))
if
(
!
lphttpHdr
->
lpszValue
&&
(
dwModifier
&
HTTP_ADDHDR_FLAG_ADD
||
dwModifier
&
HTTP_ADDHDR_FLAG_ADD_IF_NEW
))
{
INT
slen
;
...
...
@@ -2718,7 +2719,8 @@ static BOOL HTTP_ProcessHeader(LPWININETHTTPREQW lpwhr, LPCWSTR field, LPCWSTR v
}
else
if
(
lphttpHdr
->
lpszValue
)
{
if
(
dwModifier
&
HTTP_ADDHDR_FLAG_REPLACE
)
if
(
dwModifier
&
HTTP_ADDHDR_FLAG_REPLACE
||
dwModifier
&
HTTP_ADDHDR_FLAG_ADD
)
bSuccess
=
HTTP_ReplaceHeaderValue
(
lphttpHdr
,
value
);
else
if
(
dwModifier
&
COALESCEFLASG
)
{
...
...
dlls/wininet/tests/http.c
View file @
9e68c651
...
...
@@ -1114,6 +1114,35 @@ static void HttpSendRequestEx_test(void)
ok
(
InternetCloseHandle
(
hSession
),
"Close session handle failed
\n
"
);
}
static
void
HttpHeaders_test
(
void
)
{
HINTERNET
hSession
;
HINTERNET
hConnect
;
HINTERNET
hRequest
;
hSession
=
InternetOpen
(
"Wine Regression Test"
,
INTERNET_OPEN_TYPE_PRECONFIG
,
NULL
,
NULL
,
0
);
ok
(
hSession
!=
NULL
,
"Unable to open Internet session
\n
"
);
hConnect
=
InternetConnect
(
hSession
,
"crossover.codeweavers.com"
,
INTERNET_DEFAULT_HTTP_PORT
,
NULL
,
NULL
,
INTERNET_SERVICE_HTTP
,
0
,
0
);
ok
(
hConnect
!=
NULL
,
"Unable to connect to http://crossover.codeweavers.com
\n
"
);
hRequest
=
HttpOpenRequest
(
hConnect
,
"POST"
,
"/posttest.php"
,
NULL
,
NULL
,
NULL
,
INTERNET_FLAG_NO_CACHE_WRITE
,
0
);
ok
(
hRequest
!=
NULL
,
"Failed to open request handle
\n
"
);
ok
(
HttpAddRequestHeaders
(
hRequest
,
"Warning:test1"
,
-
1
,
HTTP_ADDREQ_FLAG_ADD
),
"Failed to add new header
\n
"
);
ok
(
HttpAddRequestHeaders
(
hRequest
,
"Warning:test2"
,
-
1
,
HTTP_ADDREQ_FLAG_ADD
),
"Failed to replace header using HTTP_ADDREQ_FLAG_ADD
\n
"
);
ok
(
HttpAddRequestHeaders
(
hRequest
,
"Warning:test3"
,
-
1
,
HTTP_ADDREQ_FLAG_REPLACE
),
"Failed to replace header using HTTP_ADDREQ_FLAG_REPLACE
\n
"
);
ok
(
HttpAddRequestHeaders
(
hRequest
,
"Warning:test4"
,
-
1
,
HTTP_ADDREQ_FLAG_ADD_IF_NEW
)
==
0
,
"HTTP_ADDREQ_FLAG_ADD_IF_NEW replaced existing header
\n
"
);
ok
(
InternetCloseHandle
(
hRequest
),
"Close request handle failed
\n
"
);
ok
(
InternetCloseHandle
(
hConnect
),
"Close connect handle failed
\n
"
);
ok
(
InternetCloseHandle
(
hSession
),
"Close session handle failed
\n
"
);
}
START_TEST
(
http
)
{
InternetReadFile_test
(
INTERNET_FLAG_ASYNC
);
...
...
@@ -1128,4 +1157,5 @@ START_TEST(http)
InternetTimeToSystemTimeW_test
();
InternetCreateUrlA_test
();
HttpSendRequestEx_test
();
HttpHeaders_test
();
}
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