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
84832258
Commit
84832258
authored
Mar 10, 2015
by
Tatsuhiro Tsujikawa
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
nghttpx: Don't rewrite host for CONNECT method
parent
585af938
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
10 additions
and
6 deletions
+10
-6
src/shrpx_downstream.cc
src/shrpx_downstream.cc
+1
-1
src/shrpx_http2_downstream_connection.cc
src/shrpx_http2_downstream_connection.cc
+7
-4
src/shrpx_http_downstream_connection.cc
src/shrpx_http_downstream_connection.cc
+2
-1
No files found.
src/shrpx_downstream.cc
View file @
84832258
...
@@ -619,7 +619,7 @@ void Downstream::rewrite_location_response_header(
...
@@ -619,7 +619,7 @@ void Downstream::rewrite_location_response_header(
return
;
return
;
}
}
std
::
string
new_uri
;
std
::
string
new_uri
;
if
(
get_config
()
->
no_host_rewrite
)
{
if
(
get_config
()
->
no_host_rewrite
||
request_method_
==
"CONNECT"
)
{
if
(
!
request_http2_authority_
.
empty
())
{
if
(
!
request_http2_authority_
.
empty
())
{
new_uri
=
http2
::
rewrite_location_uri
(
new_uri
=
http2
::
rewrite_location_uri
(
(
*
hd
).
value
,
u
,
request_http2_authority_
,
request_http2_authority_
,
(
*
hd
).
value
,
u
,
request_http2_authority_
,
request_http2_authority_
,
...
...
src/shrpx_http2_downstream_connection.cc
View file @
84832258
...
@@ -253,9 +253,13 @@ int Http2DownstreamConnection::push_request_headers() {
...
@@ -253,9 +253,13 @@ int Http2DownstreamConnection::push_request_headers() {
downstream_
->
set_request_pending
(
false
);
downstream_
->
set_request_pending
(
false
);
auto
no_host_rewrite
=
get_config
()
->
no_host_rewrite
||
get_config
()
->
http2_proxy
||
get_config
()
->
client_proxy
||
downstream_
->
get_request_method
()
==
"CONNECT"
;
const
char
*
authority
=
nullptr
,
*
host
=
nullptr
;
const
char
*
authority
=
nullptr
,
*
host
=
nullptr
;
if
(
!
get_config
()
->
no_host_rewrite
&&
!
get_config
()
->
http2_proxy
&&
if
(
!
no_host_rewrite
)
{
!
get_config
()
->
client_proxy
)
{
// HTTP/2 backend does not support multiple address, so we always
// HTTP/2 backend does not support multiple address, so we always
// use index = 0.
// use index = 0.
if
(
!
downstream_
->
get_request_http2_authority
().
empty
())
{
if
(
!
downstream_
->
get_request_http2_authority
().
empty
())
{
...
@@ -369,8 +373,7 @@ int Http2DownstreamConnection::push_request_headers() {
...
@@ -369,8 +373,7 @@ int Http2DownstreamConnection::push_request_headers() {
nva
.
push_back
(
http2
::
make_nv_ls
(
":path"
,
path
));
nva
.
push_back
(
http2
::
make_nv_ls
(
":path"
,
path
));
}
}
if
(
!
get_config
()
->
no_host_rewrite
&&
!
get_config
()
->
http2_proxy
&&
if
(
!
no_host_rewrite
)
{
!
get_config
()
->
client_proxy
)
{
if
(
authority
)
{
if
(
authority
)
{
nva
.
push_back
(
http2
::
make_nv_lc
(
":authority"
,
authority
));
nva
.
push_back
(
http2
::
make_nv_lc
(
":authority"
,
authority
));
}
}
...
...
src/shrpx_http_downstream_connection.cc
View file @
84832258
...
@@ -212,7 +212,8 @@ int HttpDownstreamConnection::attach_downstream(Downstream *downstream) {
...
@@ -212,7 +212,8 @@ int HttpDownstreamConnection::attach_downstream(Downstream *downstream) {
int
HttpDownstreamConnection
::
push_request_headers
()
{
int
HttpDownstreamConnection
::
push_request_headers
()
{
const
char
*
authority
=
nullptr
,
*
host
=
nullptr
;
const
char
*
authority
=
nullptr
,
*
host
=
nullptr
;
if
(
!
get_config
()
->
no_host_rewrite
&&
!
get_config
()
->
http2_proxy
&&
if
(
!
get_config
()
->
no_host_rewrite
&&
!
get_config
()
->
http2_proxy
&&
!
get_config
()
->
client_proxy
)
{
!
get_config
()
->
client_proxy
&&
downstream_
->
get_request_method
()
!=
"CONNECT"
)
{
if
(
!
downstream_
->
get_request_http2_authority
().
empty
())
{
if
(
!
downstream_
->
get_request_http2_authority
().
empty
())
{
authority
=
get_config
()
->
downstream_addrs
[
addr_idx_
].
hostport
.
get
();
authority
=
get_config
()
->
downstream_addrs
[
addr_idx_
].
hostport
.
get
();
}
}
...
...
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