Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
N
nghttp2
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Libraries
nghttp2
Commits
7b904040
Commit
7b904040
authored
Mar 13, 2015
by
Tatsuhiro Tsujikawa
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
nghttpx: Omit well-known port from hostport in downstream request
parent
de0543f6
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
9 additions
and
3 deletions
+9
-3
src/shrpx_http2_session.cc
src/shrpx_http2_session.cc
+4
-0
src/util.cc
src/util.cc
+4
-2
src/util.h
src/util.h
+1
-1
No files found.
src/shrpx_http2_session.cc
View file @
7b904040
...
@@ -506,6 +506,10 @@ int Http2Session::downstream_connect_proxy() {
...
@@ -506,6 +506,10 @@ int Http2Session::downstream_connect_proxy() {
std
::
string
req
=
"CONNECT "
;
std
::
string
req
=
"CONNECT "
;
req
+=
downstream_addr
.
hostport
.
get
();
req
+=
downstream_addr
.
hostport
.
get
();
if
(
downstream_addr
.
port
==
80
||
downstream_addr
.
port
==
443
)
{
req
+=
":"
;
req
+=
util
::
utos
(
downstream_addr
.
port
);
}
req
+=
" HTTP/1.1
\r\n
Host: "
;
req
+=
" HTTP/1.1
\r\n
Host: "
;
req
+=
downstream_addr
.
host
.
get
();
req
+=
downstream_addr
.
host
.
get
();
req
+=
"
\r\n
"
;
req
+=
"
\r\n
"
;
...
...
src/util.cc
View file @
7b904040
...
@@ -1038,8 +1038,10 @@ std::string make_hostport(const char *host, uint16_t port) {
...
@@ -1038,8 +1038,10 @@ std::string make_hostport(const char *host, uint16_t port) {
hostport
+=
"]"
;
hostport
+=
"]"
;
}
}
hostport
+=
":"
;
if
(
port
!=
80
&&
port
!=
443
)
{
hostport
+=
utos
(
port
);
hostport
+=
":"
;
hostport
+=
utos
(
port
);
}
return
hostport
;
return
hostport
;
}
}
...
...
src/util.h
View file @
7b904040
...
@@ -609,7 +609,7 @@ std::string format_duration(const std::chrono::microseconds &u);
...
@@ -609,7 +609,7 @@ std::string format_duration(const std::chrono::microseconds &u);
// Creates "host:port" string using given |host| and |port|. If
// Creates "host:port" string using given |host| and |port|. If
// |host| is numeric IPv6 address (e.g., ::1), it is enclosed by "["
// |host| is numeric IPv6 address (e.g., ::1), it is enclosed by "["
// and "]".
// and "]".
If |port| is 80 or 443, port part is omitted.
std
::
string
make_hostport
(
const
char
*
host
,
uint16_t
port
);
std
::
string
make_hostport
(
const
char
*
host
,
uint16_t
port
);
}
// namespace util
}
// namespace util
...
...
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