diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-06-12 05:35:29 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-06-12 05:35:29 +0000 |
commit | 59203c63bb777a3bacec32fb8830fba33540e809 (patch) | |
tree | 58298e711c0ff0575818c30485b44a2f21bf28a0 /testing/web-platform/tests/tools/wptserve | |
parent | Adding upstream version 126.0.1. (diff) | |
download | firefox-59203c63bb777a3bacec32fb8830fba33540e809.tar.xz firefox-59203c63bb777a3bacec32fb8830fba33540e809.zip |
Adding upstream version 127.0.upstream/127.0
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'testing/web-platform/tests/tools/wptserve')
5 files changed, 16 insertions, 13 deletions
diff --git a/testing/web-platform/tests/tools/wptserve/setup.py b/testing/web-platform/tests/tools/wptserve/setup.py index 1496fa7e17..36aa98f1d8 100644 --- a/testing/web-platform/tests/tools/wptserve/setup.py +++ b/testing/web-platform/tests/tools/wptserve/setup.py @@ -1,7 +1,10 @@ from setuptools import setup -PACKAGE_VERSION = '4.0' -deps = ["h2>=4.1.0"] +PACKAGE_VERSION = '4.0.2' +deps = [ + "h2>=4.1.0", + "pywebsocket3>=4.0.2", +] setup(name='wptserve', version=PACKAGE_VERSION, diff --git a/testing/web-platform/tests/tools/wptserve/wptserve/response.py b/testing/web-platform/tests/tools/wptserve/wptserve/response.py index a6ece62dab..8d0e01bbdd 100644 --- a/testing/web-platform/tests/tools/wptserve/wptserve/response.py +++ b/testing/web-platform/tests/tools/wptserve/wptserve/response.py @@ -4,7 +4,7 @@ import json import uuid import traceback from collections import OrderedDict -from datetime import datetime, timedelta +from datetime import datetime, timedelta, timezone from io import BytesIO from hpack.struct import HeaderTuple @@ -135,7 +135,7 @@ class Response: "oct", "nov", "dec"])} if isinstance(expires, timedelta): - expires = datetime.utcnow() + expires + expires = datetime.now(timezone.utc) + expires if expires is not None: expires_str = expires.strftime("%d %%s %Y %H:%M:%S GMT") diff --git a/testing/web-platform/tests/tools/wptserve/wptserve/server.py b/testing/web-platform/tests/tools/wptserve/wptserve/server.py index 8ce36201ee..1863861542 100644 --- a/testing/web-platform/tests/tools/wptserve/wptserve/server.py +++ b/testing/web-platform/tests/tools/wptserve/wptserve/server.py @@ -23,8 +23,8 @@ from h2.utilities import extract_method_header from urllib.parse import urlsplit, urlunsplit -from mod_pywebsocket import dispatch -from mod_pywebsocket.handshake import HandshakeException, AbortedByUserException +from pywebsocket3 import dispatch +from pywebsocket3.handshake import HandshakeException, AbortedByUserException from . import routes as default_routes from .config import ConfigBuilder diff --git a/testing/web-platform/tests/tools/wptserve/wptserve/sslutils/openssl.py b/testing/web-platform/tests/tools/wptserve/wptserve/sslutils/openssl.py index 5a16097e37..25f86e019e 100644 --- a/testing/web-platform/tests/tools/wptserve/wptserve/sslutils/openssl.py +++ b/testing/web-platform/tests/tools/wptserve/wptserve/sslutils/openssl.py @@ -6,7 +6,7 @@ import random import shutil import subprocess import tempfile -from datetime import datetime, timedelta +from datetime import datetime, timedelta, timezone # Amount of time beyond the present to consider certificates "expired." This # allows certificates to be proactively re-generated in the "buffer" period @@ -316,7 +316,7 @@ class OpenSSLEnvironment: # Because `strptime` does not account for time zone offsets, it is # always in terms of UTC, so the current time should be calculated # accordingly. - if end_date < datetime.utcnow() + time_buffer: + if end_date < datetime.now(timezone.utc) + time_buffer: return False #TODO: check the key actually signed the cert. diff --git a/testing/web-platform/tests/tools/wptserve/wptserve/ws_h2_handshake.py b/testing/web-platform/tests/tools/wptserve/wptserve/ws_h2_handshake.py index af668dd558..ab1ab958a0 100644 --- a/testing/web-platform/tests/tools/wptserve/wptserve/ws_h2_handshake.py +++ b/testing/web-platform/tests/tools/wptserve/wptserve/ws_h2_handshake.py @@ -7,12 +7,12 @@ Specification: https://tools.ietf.org/html/rfc8441 """ -from mod_pywebsocket import common +from pywebsocket3 import common -from mod_pywebsocket.handshake.base import get_mandatory_header -from mod_pywebsocket.handshake.base import HandshakeException -from mod_pywebsocket.handshake.base import validate_mandatory_header -from mod_pywebsocket.handshake.base import HandshakerBase +from pywebsocket3.handshake.base import get_mandatory_header +from pywebsocket3.handshake.base import HandshakeException +from pywebsocket3.handshake.base import validate_mandatory_header +from pywebsocket3.handshake.base import HandshakerBase def check_connect_method(request): |