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
53b3fba0
Commit
53b3fba0
authored
Nov 18, 2013
by
Tatsuhiro Tsujikawa
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
nghttpx: Add --http2-no-cookie-crumbling option
parent
faedc438
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
17 additions
and
1 deletion
+17
-1
src/shrpx.cc
src/shrpx.cc
+9
-0
src/shrpx_config.cc
src/shrpx_config.cc
+3
-0
src/shrpx_config.h
src/shrpx_config.h
+2
-0
src/shrpx_http2_downstream_connection.cc
src/shrpx_http2_downstream_connection.cc
+3
-1
No files found.
src/shrpx.cc
View file @
53b3fba0
...
...
@@ -422,6 +422,7 @@ void fill_default_config()
mod_config
()
->
client_cert_file
=
nullptr
;
mod_config
()
->
http2_upstream_dump_request_header
=
nullptr
;
mod_config
()
->
http2_upstream_dump_response_header
=
nullptr
;
mod_config
()
->
http2_no_cookie_crumbling
=
false
;
}
}
// namespace
...
...
@@ -630,6 +631,8 @@ void print_help(std::ostream& out)
<<
" Default: "
<<
get_config
()
->
http2_downstream_window_bits
<<
"
\n
"
<<
" --backend-no-tls Disable SSL/TLS on backend connections.
\n
"
<<
" --http2-no-cookie-crumbling
\n
"
<<
" Don't crumble cookie header field.
\n
"
<<
"
\n
"
<<
" Mode:
\n
"
<<
" (default mode) Accept HTTP/2.0, SPDY and HTTP/1.1 over
\n
"
...
...
@@ -770,6 +773,7 @@ int main(int argc, char **argv)
{
"client-cert-file"
,
required_argument
,
&
flag
,
42
},
{
"frontend-http2-dump-request-header"
,
required_argument
,
&
flag
,
43
},
{
"frontend-http2-dump-response-header"
,
required_argument
,
&
flag
,
44
},
{
"http2-no-cookie-crumbling"
,
no_argument
,
&
flag
,
45
},
{
nullptr
,
0
,
nullptr
,
0
}
};
...
...
@@ -1004,6 +1008,11 @@ int main(int argc, char **argv)
(
SHRPX_OPT_FRONTEND_HTTP2_DUMP_RESPONSE_HEADER
,
optarg
));
break
;
case
45
:
// --http2-no-cookie-crumbling
cmdcfgs
.
push_back
(
std
::
make_pair
(
SHRPX_OPT_HTTP2_NO_COOKIE_CRUMBLING
,
"yes"
));
break
;
default:
break
;
}
...
...
src/shrpx_config.cc
View file @
53b3fba0
...
...
@@ -109,6 +109,7 @@ const char SHRPX_OPT_FRONTEND_HTTP2_DUMP_REQUEST_HEADER[] =
"frontend-http2-dump-request-header"
;
const
char
SHRPX_OPT_FRONTEND_HTTP2_DUMP_RESPONSE_HEADER
[]
=
"frontend-http2-dump-response-header"
;
const
char
SHRPX_OPT_HTTP2_NO_COOKIE_CRUMBLING
[]
=
"http2-no-cookie-crumbling"
;
namespace
{
Config
*
config
=
nullptr
;
...
...
@@ -447,6 +448,8 @@ int parse_config(const char *opt, const char *optarg)
return
-
1
;
}
mod_config
()
->
http2_upstream_dump_response_header
=
f
;
}
else
if
(
util
::
strieq
(
opt
,
SHRPX_OPT_HTTP2_NO_COOKIE_CRUMBLING
))
{
mod_config
()
->
http2_no_cookie_crumbling
=
util
::
strieq
(
optarg
,
"yes"
);
}
else
if
(
util
::
strieq
(
opt
,
"conf"
))
{
LOG
(
WARNING
)
<<
"conf is ignored"
;
}
else
{
...
...
src/shrpx_config.h
View file @
53b3fba0
...
...
@@ -98,6 +98,7 @@ extern const char SHRPX_OPT_CLIENT_PRIVATE_KEY_FILE[];
extern
const
char
SHRPX_OPT_CLIENT_CERT_FILE
[];
extern
const
char
SHRPX_OPT_FRONTEND_HTTP2_DUMP_REQUEST_HEADER
[];
extern
const
char
SHRPX_OPT_FRONTEND_HTTP2_DUMP_RESPONSE_HEADER
[];
extern
const
char
SHRPX_OPT_HTTP2_NO_COOKIE_CRUMBLING
[];
union
sockaddr_union
{
sockaddr
sa
;
...
...
@@ -200,6 +201,7 @@ struct Config {
char
*
client_cert_file
;
FILE
*
http2_upstream_dump_request_header
;
FILE
*
http2_upstream_dump_response_header
;
bool
http2_no_cookie_crumbling
;
};
const
Config
*
get_config
();
...
...
src/shrpx_http2_downstream_connection.cc
View file @
53b3fba0
...
...
@@ -228,7 +228,9 @@ int Http2DownstreamConnection::push_request_headers()
return
0
;
}
size_t
nheader
=
downstream_
->
get_request_headers
().
size
();
downstream_
->
crumble_request_cookie
();
if
(
!
get_config
()
->
http2_no_cookie_crumbling
)
{
downstream_
->
crumble_request_cookie
();
}
downstream_
->
normalize_request_headers
();
auto
end_headers
=
std
::
end
(
downstream_
->
get_request_headers
());
// 12 means:
...
...
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