The cinder.api.urlmap Module

The cinder.api.urlmap Module

class Accept(value)

Bases: object


Find parameters in Accept header for given content type.

class URLMap(not_found_app=None)

Bases: paste.urlmap.URLMap


Parse lists as described by RFC 2068 Section 2.

In particular, parse comma-separated lists where the elements of the list may include quoted-strings. A quoted-string could contain a comma. A non-quoted string could have quotes in the middle. Quotes are removed automatically after parsing.

The return value is a standard list:

>>> parse_list_header('token, "quoted value"')
['token', 'quoted value']
Parameters:value – a string with a list header.

Parse ‘Content-Type’-like header into a tuple.

Parse a Content-Type like header into a tuple with the content type and the options:

>>> parse_options_header('Content-Type: text/html; mimetype=text/html')
('Content-Type:', {'mimetype': 'text/html'})
Parameters:value – the header to parse.
Returns:(str, options)

Unquotes a header value.

This does not use the real unquoting but what browsers are actually using for quoting.

Parameters:value – the header value to unquote.
urlmap_factory(loader, global_conf, **local_conf)
Creative Commons Attribution 3.0 License

Except where otherwise noted, this document is licensed under Creative Commons Attribution 3.0 License. See all OpenStack Legal Documents.