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
5594f0ef
Commit
5594f0ef
authored
Aug 02, 2013
by
Tatsuhiro Tsujikawa
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
nghttpx: Preserve upgrade in Connection header field
parent
8fd1953b
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
4 deletions
+7
-4
src/shrpx_http_downstream_connection.cc
src/shrpx_http_downstream_connection.cc
+7
-4
No files found.
src/shrpx_http_downstream_connection.cc
View file @
5594f0ef
...
@@ -118,7 +118,7 @@ int HttpDownstreamConnection::push_request_headers()
...
@@ -118,7 +118,7 @@ int HttpDownstreamConnection::push_request_headers()
hdrs
+=
downstream_
->
get_request_path
();
hdrs
+=
downstream_
->
get_request_path
();
hdrs
+=
" "
;
hdrs
+=
" "
;
hdrs
+=
"HTTP/1.1
\r\n
"
;
hdrs
+=
"HTTP/1.1
\r\n
"
;
bool
connection_upgrade
=
fals
e
;
std
::
string
connection_upgrad
e
;
std
::
string
via_value
;
std
::
string
via_value
;
std
::
string
xff_value
;
std
::
string
xff_value
;
const
Headers
&
request_headers
=
downstream_
->
get_request_headers
();
const
Headers
&
request_headers
=
downstream_
->
get_request_headers
();
...
@@ -126,8 +126,9 @@ int HttpDownstreamConnection::push_request_headers()
...
@@ -126,8 +126,9 @@ int HttpDownstreamConnection::push_request_headers()
i
!=
request_headers
.
end
();
++
i
)
{
i
!=
request_headers
.
end
();
++
i
)
{
if
(
util
::
strieq
((
*
i
).
first
.
c_str
(),
"connection"
))
{
if
(
util
::
strieq
((
*
i
).
first
.
c_str
(),
"connection"
))
{
if
(
util
::
strifind
((
*
i
).
second
.
c_str
(),
"upgrade"
))
{
if
(
util
::
strifind
((
*
i
).
second
.
c_str
(),
"upgrade"
))
{
connection_upgrade
=
true
;
connection_upgrade
=
(
*
i
).
second
;
}
}
continue
;
}
else
if
(
util
::
strieq
((
*
i
).
first
.
c_str
(),
"x-forwarded-proto"
)
||
}
else
if
(
util
::
strieq
((
*
i
).
first
.
c_str
(),
"x-forwarded-proto"
)
||
util
::
strieq
((
*
i
).
first
.
c_str
(),
"keep-alive"
)
||
util
::
strieq
((
*
i
).
first
.
c_str
(),
"keep-alive"
)
||
util
::
strieq
((
*
i
).
first
.
c_str
(),
"proxy-connection"
))
{
util
::
strieq
((
*
i
).
first
.
c_str
(),
"proxy-connection"
))
{
...
@@ -153,8 +154,10 @@ int HttpDownstreamConnection::push_request_headers()
...
@@ -153,8 +154,10 @@ int HttpDownstreamConnection::push_request_headers()
}
}
if
(
downstream_
->
get_request_connection_close
())
{
if
(
downstream_
->
get_request_connection_close
())
{
hdrs
+=
"Connection: close
\r\n
"
;
hdrs
+=
"Connection: close
\r\n
"
;
}
else
if
(
connection_upgrade
)
{
}
else
if
(
!
connection_upgrade
.
empty
())
{
hdrs
+=
"Connection: upgrade
\r\n
"
;
hdrs
+=
"Connection: "
;
hdrs
+=
connection_upgrade
;
hdrs
+=
"
\r\n
"
;
}
}
if
(
get_config
()
->
add_x_forwarded_for
)
{
if
(
get_config
()
->
add_x_forwarded_for
)
{
hdrs
+=
"X-Forwarded-For: "
;
hdrs
+=
"X-Forwarded-For: "
;
...
...
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