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
60a8bb68
Commit
60a8bb68
authored
Nov 15, 2018
by
Hans Leidekker
Committed by
Alexandre Julliard
Nov 15, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
winhttp: Skip the hostname part when escaping an absolute URL.
Signed-off-by:
Hans Leidekker
<
hans@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
a6edca34
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
9 deletions
+10
-9
request.c
dlls/winhttp/request.c
+10
-9
No files found.
dlls/winhttp/request.c
View file @
60a8bb68
...
...
@@ -541,7 +541,7 @@ BOOL WINAPI WinHttpAddRequestHeaders( HINTERNET hrequest, LPCWSTR headers, DWORD
return
ret
;
}
static
WCHAR
*
build_absolute_request_path
(
request_t
*
request
)
static
WCHAR
*
build_absolute_request_path
(
request_t
*
request
,
const
WCHAR
**
path
)
{
static
const
WCHAR
http
[]
=
{
'h'
,
't'
,
't'
,
'p'
,
0
};
static
const
WCHAR
https
[]
=
{
'h'
,
't'
,
't'
,
'p'
,
's'
,
0
};
...
...
@@ -555,16 +555,17 @@ static WCHAR *build_absolute_request_path( request_t *request )
len
=
strlenW
(
scheme
)
+
strlenW
(
request
->
connect
->
hostname
)
+
4
;
/* '://' + nul */
if
(
request
->
connect
->
hostport
)
len
+=
6
;
/* ':' between host and port, up to 5 for port */
if
(
request
->
path
)
len
+=
strlenW
(
request
->
path
);
len
+=
strlenW
(
request
->
path
);
if
((
ret
=
heap_alloc
(
len
*
sizeof
(
WCHAR
)
)))
{
len
=
sprintfW
(
ret
,
fmt
,
scheme
,
request
->
connect
->
hostname
);
if
(
request
->
connect
->
hostport
)
{
static
const
WCHAR
port_fmt
[]
=
{
':'
,
'%'
,
'u'
,
0
};
sprintfW
(
ret
+
len
,
port_fmt
,
request
->
connect
->
hostport
);
len
+=
sprintfW
(
ret
+
len
,
port_fmt
,
request
->
connect
->
hostport
);
}
if
(
request
->
path
)
strcatW
(
ret
,
request
->
path
);
strcpyW
(
ret
+
len
,
request
->
path
);
if
(
path
)
*
path
=
ret
+
len
;
}
return
ret
;
...
...
@@ -578,7 +579,7 @@ static WCHAR *build_request_string( request_t *request )
unsigned
int
i
,
len
;
if
(
!
strcmpiW
(
request
->
connect
->
hostname
,
request
->
connect
->
servername
))
path
=
request
->
path
;
else
if
(
!
(
path
=
build_absolute_request_path
(
request
)))
return
NULL
;
else
if
(
!
(
path
=
build_absolute_request_path
(
request
,
NULL
)))
return
NULL
;
len
=
strlenW
(
request
->
verb
)
+
1
/* ' ' */
;
len
+=
strlenW
(
path
)
+
1
/* ' ' */
;
...
...
@@ -2125,16 +2126,16 @@ static DWORD str_to_wire( const WCHAR *src, int src_len, char *dst, enum escape_
static
char
*
build_wire_path
(
request_t
*
request
,
DWORD
*
ret_len
)
{
WCHAR
*
full_path
;
const
WCHAR
*
path
,
*
query
=
NULL
;
const
WCHAR
*
start
,
*
path
,
*
query
=
NULL
;
DWORD
len
,
len_path
=
0
,
len_query
=
0
;
enum
escape_flags
path_flags
,
query_flags
;
char
*
ret
;
if
(
!
strcmpiW
(
request
->
connect
->
hostname
,
request
->
connect
->
servername
))
full_path
=
request
->
path
;
else
if
(
!
(
full_path
=
build_absolute_request_path
(
request
)))
return
NULL
;
if
(
!
strcmpiW
(
request
->
connect
->
hostname
,
request
->
connect
->
servername
))
start
=
full_path
=
request
->
path
;
else
if
(
!
(
full_path
=
build_absolute_request_path
(
request
,
&
start
)))
return
NULL
;
len
=
strlenW
(
full_path
);
if
((
path
=
strchrW
(
full_path
,
'/'
)))
if
((
path
=
strchrW
(
start
,
'/'
)))
{
len_path
=
strlenW
(
path
);
if
((
query
=
strchrW
(
path
,
'?'
)))
...
...
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