mirror of
https://github.com/Tautulli/Tautulli.git
synced 2025-07-07 13:41:15 -07:00
Bump cheroot from 8.6.0 to 9.0.0 (#1903)
* Bump cheroot from 8.6.0 to 9.0.0 Bumps [cheroot](https://github.com/cherrypy/cheroot) from 8.6.0 to 9.0.0. - [Release notes](https://github.com/cherrypy/cheroot/releases) - [Changelog](https://github.com/cherrypy/cheroot/blob/main/CHANGES.rst) - [Commits](https://github.com/cherrypy/cheroot/compare/v8.6.0...v9.0.0) --- updated-dependencies: - dependency-name: cheroot dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] <support@github.com> * Update cheroot==9.0.0 Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: JonnyWong16 <9099342+JonnyWong16@users.noreply.github.com> [skip ci]
This commit is contained in:
parent
0a5edebea3
commit
3d378eb583
33 changed files with 287 additions and 851 deletions
|
@ -25,14 +25,8 @@ as you want in one instance by using a PathInfoDispatcher::
|
|||
server = wsgi.Server(addr, d)
|
||||
"""
|
||||
|
||||
from __future__ import absolute_import, division, print_function
|
||||
__metaclass__ = type
|
||||
|
||||
import sys
|
||||
|
||||
import six
|
||||
from six.moves import filter
|
||||
|
||||
from . import server
|
||||
from .workers import threadpool
|
||||
from ._compat import ntob, bton
|
||||
|
@ -140,7 +134,7 @@ class Gateway(server.Gateway):
|
|||
response = self.req.server.wsgi_app(self.env, self.start_response)
|
||||
try:
|
||||
for chunk in filter(None, response):
|
||||
if not isinstance(chunk, six.binary_type):
|
||||
if not isinstance(chunk, bytes):
|
||||
raise ValueError('WSGI Applications must yield bytes')
|
||||
self.write(chunk)
|
||||
finally:
|
||||
|
@ -149,7 +143,7 @@ class Gateway(server.Gateway):
|
|||
if hasattr(response, 'close'):
|
||||
response.close()
|
||||
|
||||
def start_response(self, status, headers, exc_info=None):
|
||||
def start_response(self, status, headers, exc_info=None): # noqa: WPS238
|
||||
"""WSGI callable to begin the HTTP response."""
|
||||
# "The application may call start_response more than once,
|
||||
# if and only if the exc_info argument is provided."
|
||||
|
@ -164,10 +158,8 @@ class Gateway(server.Gateway):
|
|||
# sent, start_response must raise an error, and should raise the
|
||||
# exc_info tuple."
|
||||
if self.req.sent_headers:
|
||||
try:
|
||||
six.reraise(*exc_info)
|
||||
finally:
|
||||
exc_info = None
|
||||
value = exc_info[1]
|
||||
raise value
|
||||
|
||||
self.req.status = self._encode_status(status)
|
||||
|
||||
|
@ -196,8 +188,6 @@ class Gateway(server.Gateway):
|
|||
must be of type "str" but are restricted to code points in the
|
||||
"Latin-1" set.
|
||||
"""
|
||||
if six.PY2:
|
||||
return status
|
||||
if not isinstance(status, str):
|
||||
raise TypeError('WSGI response status is not of type str.')
|
||||
return status.encode('ISO-8859-1')
|
||||
|
@ -273,7 +263,7 @@ class Gateway_10(Gateway):
|
|||
'wsgi.version': self.version,
|
||||
}
|
||||
|
||||
if isinstance(req.server.bind_addr, six.string_types):
|
||||
if isinstance(req.server.bind_addr, str):
|
||||
# AF_UNIX. This isn't really allowed by WSGI, which doesn't
|
||||
# address unix domain sockets. But it's better than nothing.
|
||||
env['SERVER_PORT'] = ''
|
||||
|
@ -332,10 +322,10 @@ class Gateway_u0(Gateway_10):
|
|||
"""Return a new environ dict targeting the given wsgi.version."""
|
||||
req = self.req
|
||||
env_10 = super(Gateway_u0, self).get_environ()
|
||||
env = dict(map(self._decode_key, env_10.items()))
|
||||
env = dict(env_10.items())
|
||||
|
||||
# Request-URI
|
||||
enc = env.setdefault(six.u('wsgi.url_encoding'), six.u('utf-8'))
|
||||
enc = env.setdefault('wsgi.url_encoding', 'utf-8')
|
||||
try:
|
||||
env['PATH_INFO'] = req.path.decode(enc)
|
||||
env['QUERY_STRING'] = req.qs.decode(enc)
|
||||
|
@ -345,25 +335,10 @@ class Gateway_u0(Gateway_10):
|
|||
env['PATH_INFO'] = env_10['PATH_INFO']
|
||||
env['QUERY_STRING'] = env_10['QUERY_STRING']
|
||||
|
||||
env.update(map(self._decode_value, env.items()))
|
||||
env.update(env.items())
|
||||
|
||||
return env
|
||||
|
||||
@staticmethod
|
||||
def _decode_key(item):
|
||||
k, v = item
|
||||
if six.PY2:
|
||||
k = k.decode('ISO-8859-1')
|
||||
return k, v
|
||||
|
||||
@staticmethod
|
||||
def _decode_value(item):
|
||||
k, v = item
|
||||
skip_keys = 'REQUEST_URI', 'wsgi.input'
|
||||
if not six.PY2 or not isinstance(v, bytes) or k in skip_keys:
|
||||
return k, v
|
||||
return k, v.decode('ISO-8859-1')
|
||||
|
||||
|
||||
wsgi_gateways = Gateway.gateway_map()
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue