Merge "Allow operators to customize max header size"

This commit is contained in:
Jenkins 2014-02-13 05:06:20 +00:00 committed by Gerrit Code Review
commit 3fe6cf5459
2 changed files with 18 additions and 3 deletions

View File

@ -59,14 +59,21 @@ socket_opts = [
"the server securely"),
]
eventlet_opts = [
cfg.IntOpt('max_header_line',
default=16384,
help="Maximum line size of message headers to be accepted. "
"max_header_line may need to be increased when using "
"large tokens (typically those generated by the "
"Keystone v3 API with big service catalogs)."),
]
CONF = cfg.CONF
CONF.register_opts(socket_opts)
CONF.register_opts(eventlet_opts)
LOG = logging.getLogger(__name__)
# Raise the default from 8192 to accommodate large tokens
eventlet.wsgi.MAX_HEADER_LINE = 16384
class Server(object):
"""Server class to manage a WSGI server, serving a WSGI application."""
@ -85,6 +92,8 @@ class Server(object):
:returns: None
"""
# Allow operators to customize http requests max header line size.
eventlet.wsgi.MAX_HEADER_LINE = CONF.max_header_line
self.name = name
self.app = app
self._host = host or "0.0.0.0"

View File

@ -93,6 +93,12 @@
# Options defined in cinder.wsgi
#
# Maximum line size of message headers to be accepted.
# max_header_line may need to be increased when using large
# tokens (typically those generated by the Keystone v3 API
# with big service catalogs). (integer value)
#max_header_line=16384
# Sets the value of TCP_KEEPIDLE in seconds for each server
# socket. Not supported on OS X. (integer value)
#tcp_keepidle=600