Update Tornado Web Server 6.3.0 (7186b86) → 6.3.1 (419838b).

This commit is contained in:
JackDandy 2023-04-12 14:10:23 +01:00
parent acd1a1c613
commit 1c6a5bb59a
4 changed files with 34 additions and 16 deletions

View file

@ -1,6 +1,7 @@
### 3.29.0 (2023-xx-xx xx:xx:00 UTC) ### 3.29.0 (2023-xx-xx xx:xx:00 UTC)
* Update SimpleJSON 3.18.1 (c891b95) to 3.19.1 (aeb63ee) * Update SimpleJSON 3.18.1 (c891b95) to 3.19.1 (aeb63ee)
* Update Tornado Web Server 6.3.0 (7186b86) to 6.3.1 (419838b)
### 3.28.0 (2023-04-12 13:05:00 UTC) ### 3.28.0 (2023-04-12 13:05:00 UTC)

View file

@ -22,8 +22,8 @@
# is zero for an official release, positive for a development branch, # is zero for an official release, positive for a development branch,
# or negative for a release candidate or beta (after the base version # or negative for a release candidate or beta (after the base version
# number has been incremented) # number has been incremented)
version = "6.3.dev1" version = "6.3.1"
version_info = (6, 3, 0, -100) version_info = (6, 3, 1, 0)
import importlib import importlib
import typing import typing

View file

@ -79,6 +79,7 @@ import socket
import sys import sys
import threading import threading
import time import time
import warnings
import tornado import tornado
import traceback import traceback
import types import types
@ -91,10 +92,8 @@ from tornado import gen
from tornado.httpserver import HTTPServer from tornado.httpserver import HTTPServer
from tornado import httputil from tornado import httputil
from tornado import iostream from tornado import iostream
import tornado.locale
from tornado import locale from tornado import locale
from tornado.log import access_log, app_log, gen_log from tornado.log import access_log, app_log, gen_log
import tornado.netutil
from tornado import template from tornado import template
from tornado.escape import utf8, _unicode from tornado.escape import utf8, _unicode
from tornado.routing import ( from tornado.routing import (
@ -609,6 +608,7 @@ class RequestHandler(object):
httponly: bool = False, httponly: bool = False,
secure: bool = False, secure: bool = False,
samesite: Optional[str] = None, samesite: Optional[str] = None,
**kwargs: Any,
) -> None: ) -> None:
"""Sets an outgoing cookie name/value with the given options. """Sets an outgoing cookie name/value with the given options.
@ -625,6 +625,10 @@ class RequestHandler(object):
to set an expiration time in days from today (if both are set, ``expires`` to set an expiration time in days from today (if both are set, ``expires``
is used). is used).
.. deprecated:: 6.3
Keyword arguments are currently accepted case-insensitively.
In Tornado 7.0 this will be changed to only accept lowercase
arguments.
""" """
# The cookie library only accepts type str, in both python 2 and 3 # The cookie library only accepts type str, in both python 2 and 3
name = escape.native_str(name) name = escape.native_str(name)
@ -659,6 +663,17 @@ class RequestHandler(object):
morsel["secure"] = True morsel["secure"] = True
if samesite: if samesite:
morsel["samesite"] = samesite morsel["samesite"] = samesite
if kwargs:
# The setitem interface is case-insensitive, so continue to support
# kwargs for backwards compatibility until we can remove deprecated
# features.
for k, v in kwargs.items():
morsel[k] = v
warnings.warn(
f"Deprecated arguments to set_cookie: {set(kwargs.keys())} "
"(should be lowercase)",
DeprecationWarning,
)
def clear_cookie(self, name: str, **kwargs: Any) -> None: def clear_cookie(self, name: str, **kwargs: Any) -> None:
"""Deletes the cookie with the given name. """Deletes the cookie with the given name.
@ -1486,7 +1501,8 @@ class RequestHandler(object):
if version is None: if version is None:
if self.current_user and "expires_days" not in cookie_kwargs: if self.current_user and "expires_days" not in cookie_kwargs:
cookie_kwargs["expires_days"] = 30 cookie_kwargs["expires_days"] = 30
self.set_cookie("_xsrf", self._xsrf_token, **cookie_kwargs) cookie_name = self.settings.get("xsrf_cookie_name", "_xsrf")
self.set_cookie(cookie_name, self._xsrf_token, **cookie_kwargs)
return self._xsrf_token return self._xsrf_token
def _get_raw_xsrf_token(self) -> Tuple[Optional[int], bytes, float]: def _get_raw_xsrf_token(self) -> Tuple[Optional[int], bytes, float]:
@ -1501,7 +1517,8 @@ class RequestHandler(object):
for version 1 cookies) for version 1 cookies)
""" """
if not hasattr(self, "_raw_xsrf_token"): if not hasattr(self, "_raw_xsrf_token"):
cookie = self.get_cookie("_xsrf") cookie_name = self.settings.get("xsrf_cookie_name", "_xsrf")
cookie = self.get_cookie(cookie_name)
if cookie: if cookie:
version, token, timestamp = self._decode_xsrf_token(cookie) version, token, timestamp = self._decode_xsrf_token(cookie)
else: else:

View file

@ -1,16 +1,11 @@
"""Implementation of the WebSocket protocol. """Implementation of the WebSocket protocol.
`WebSockets <http://dev.w3.org/html5/websockets/>`_ allow for bidirectional `WebSockets <http://dev.w3.org/html5/websockets/>`_ allow for bidirectional
communication between the browser and server. communication between the browser and server. WebSockets are supported in the
current versions of all major browsers.
WebSockets are supported in the current versions of all major browsers,
although older versions that do not support WebSockets are still in use
(refer to http://caniuse.com/websockets for details).
This module implements the final version of the WebSocket protocol as This module implements the final version of the WebSocket protocol as
defined in `RFC 6455 <http://tools.ietf.org/html/rfc6455>`_. Certain defined in `RFC 6455 <http://tools.ietf.org/html/rfc6455>`_.
browser versions (notably Safari 5.x) implemented an earlier draft of
the protocol (known as "draft 76") and are not compatible with this module.
.. versionchanged:: 4.0 .. versionchanged:: 4.0
Removed support for the draft 76 protocol version. Removed support for the draft 76 protocol version.
@ -23,7 +18,7 @@ import hashlib
import os import os
import sys import sys
import struct import struct
import tornado.web import tornado
from urllib.parse import urlparse from urllib.parse import urlparse
import zlib import zlib
@ -1589,6 +1584,7 @@ def websocket_connect(
ping_timeout: Optional[float] = None, ping_timeout: Optional[float] = None,
max_message_size: int = _default_max_message_size, max_message_size: int = _default_max_message_size,
subprotocols: Optional[List[str]] = None, subprotocols: Optional[List[str]] = None,
resolver: Optional[Resolver] = None,
) -> "Awaitable[WebSocketClientConnection]": ) -> "Awaitable[WebSocketClientConnection]":
"""Client-side websocket support. """Client-side websocket support.
@ -1632,6 +1628,9 @@ def websocket_connect(
.. versionchanged:: 5.1 .. versionchanged:: 5.1
Added the ``subprotocols`` argument. Added the ``subprotocols`` argument.
.. versionchanged:: 6.3
Added the ``resolver`` argument.
""" """
if isinstance(url, httpclient.HTTPRequest): if isinstance(url, httpclient.HTTPRequest):
assert connect_timeout is None assert connect_timeout is None
@ -1653,6 +1652,7 @@ def websocket_connect(
ping_timeout=ping_timeout, ping_timeout=ping_timeout,
max_message_size=max_message_size, max_message_size=max_message_size,
subprotocols=subprotocols, subprotocols=subprotocols,
resolver=resolver,
) )
if callback is not None: if callback is not None:
IOLoop.current().add_future(conn.connect_future, callback) IOLoop.current().add_future(conn.connect_future, callback)