diff --git a/cinder/wsgi.py b/cinder/wsgi.py index cee88a06e05..168a1a1f04b 100644 --- a/cinder/wsgi.py +++ b/cinder/wsgi.py @@ -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" diff --git a/etc/cinder/cinder.conf.sample b/etc/cinder/cinder.conf.sample index 5cd4ce1cf85..56f3ec55d69 100644 --- a/etc/cinder/cinder.conf.sample +++ b/etc/cinder/cinder.conf.sample @@ -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