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
1de20c12
Commit
1de20c12
authored
Jan 14, 2015
by
Tatsuhiro Tsujikawa
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
nghttpx: Ignore trailer headers in HTTP/1.1
parent
8fe093de
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
16 additions
and
0 deletions
+16
-0
src/shrpx_http_downstream_connection.cc
src/shrpx_http_downstream_connection.cc
+8
-0
src/shrpx_https_upstream.cc
src/shrpx_https_upstream.cc
+8
-0
No files found.
src/shrpx_http_downstream_connection.cc
View file @
1de20c12
...
@@ -532,6 +532,10 @@ int htp_hdrs_completecb(http_parser *htp) {
...
@@ -532,6 +532,10 @@ int htp_hdrs_completecb(http_parser *htp) {
namespace
{
namespace
{
int
htp_hdr_keycb
(
http_parser
*
htp
,
const
char
*
data
,
size_t
len
)
{
int
htp_hdr_keycb
(
http_parser
*
htp
,
const
char
*
data
,
size_t
len
)
{
auto
downstream
=
static_cast
<
Downstream
*>
(
htp
->
data
);
auto
downstream
=
static_cast
<
Downstream
*>
(
htp
->
data
);
if
(
downstream
->
get_response_state
()
!=
Downstream
::
INITIAL
)
{
// ignore trailers
return
0
;
}
if
(
downstream
->
get_response_header_key_prev
())
{
if
(
downstream
->
get_response_header_key_prev
())
{
downstream
->
append_last_response_header_key
(
data
,
len
);
downstream
->
append_last_response_header_key
(
data
,
len
);
}
else
{
}
else
{
...
@@ -551,6 +555,10 @@ int htp_hdr_keycb(http_parser *htp, const char *data, size_t len) {
...
@@ -551,6 +555,10 @@ int htp_hdr_keycb(http_parser *htp, const char *data, size_t len) {
namespace
{
namespace
{
int
htp_hdr_valcb
(
http_parser
*
htp
,
const
char
*
data
,
size_t
len
)
{
int
htp_hdr_valcb
(
http_parser
*
htp
,
const
char
*
data
,
size_t
len
)
{
auto
downstream
=
static_cast
<
Downstream
*>
(
htp
->
data
);
auto
downstream
=
static_cast
<
Downstream
*>
(
htp
->
data
);
if
(
downstream
->
get_response_state
()
!=
Downstream
::
INITIAL
)
{
// ignore trailers
return
0
;
}
if
(
downstream
->
get_response_header_key_prev
())
{
if
(
downstream
->
get_response_header_key_prev
())
{
downstream
->
set_last_response_header_value
(
std
::
string
(
data
,
len
));
downstream
->
set_last_response_header_value
(
std
::
string
(
data
,
len
));
}
else
{
}
else
{
...
...
src/shrpx_https_upstream.cc
View file @
1de20c12
...
@@ -82,6 +82,10 @@ namespace {
...
@@ -82,6 +82,10 @@ namespace {
int
htp_hdr_keycb
(
http_parser
*
htp
,
const
char
*
data
,
size_t
len
)
{
int
htp_hdr_keycb
(
http_parser
*
htp
,
const
char
*
data
,
size_t
len
)
{
auto
upstream
=
static_cast
<
HttpsUpstream
*>
(
htp
->
data
);
auto
upstream
=
static_cast
<
HttpsUpstream
*>
(
htp
->
data
);
auto
downstream
=
upstream
->
get_downstream
();
auto
downstream
=
upstream
->
get_downstream
();
if
(
downstream
->
get_request_state
()
!=
Downstream
::
INITIAL
)
{
// ignore trailers
return
0
;
}
if
(
downstream
->
get_request_header_key_prev
())
{
if
(
downstream
->
get_request_header_key_prev
())
{
downstream
->
append_last_request_header_key
(
data
,
len
);
downstream
->
append_last_request_header_key
(
data
,
len
);
}
else
{
}
else
{
...
@@ -102,6 +106,10 @@ namespace {
...
@@ -102,6 +106,10 @@ namespace {
int
htp_hdr_valcb
(
http_parser
*
htp
,
const
char
*
data
,
size_t
len
)
{
int
htp_hdr_valcb
(
http_parser
*
htp
,
const
char
*
data
,
size_t
len
)
{
auto
upstream
=
static_cast
<
HttpsUpstream
*>
(
htp
->
data
);
auto
upstream
=
static_cast
<
HttpsUpstream
*>
(
htp
->
data
);
auto
downstream
=
upstream
->
get_downstream
();
auto
downstream
=
upstream
->
get_downstream
();
if
(
downstream
->
get_request_state
()
!=
Downstream
::
INITIAL
)
{
// ignore trailers
return
0
;
}
if
(
downstream
->
get_request_header_key_prev
())
{
if
(
downstream
->
get_request_header_key_prev
())
{
downstream
->
set_last_request_header_value
(
std
::
string
(
data
,
len
));
downstream
->
set_last_request_header_value
(
std
::
string
(
data
,
len
));
}
else
{
}
else
{
...
...
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