adafruit-circuitpython-httpserver 4.8.1__tar.gz → 4.8.3__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {adafruit_circuitpython_httpserver-4.8.1 → adafruit_circuitpython_httpserver-4.8.3}/.pre-commit-config.yaml +1 -1
- {adafruit_circuitpython_httpserver-4.8.1 → adafruit_circuitpython_httpserver-4.8.3}/PKG-INFO +1 -1
- {adafruit_circuitpython_httpserver-4.8.1 → adafruit_circuitpython_httpserver-4.8.3}/adafruit_circuitpython_httpserver.egg-info/PKG-INFO +1 -1
- {adafruit_circuitpython_httpserver-4.8.1 → adafruit_circuitpython_httpserver-4.8.3}/adafruit_httpserver/__init__.py +1 -1
- {adafruit_circuitpython_httpserver-4.8.1 → adafruit_circuitpython_httpserver-4.8.3}/adafruit_httpserver/server.py +22 -16
- {adafruit_circuitpython_httpserver-4.8.1 → adafruit_circuitpython_httpserver-4.8.3}/examples/httpserver_cookies.py +5 -5
- {adafruit_circuitpython_httpserver-4.8.1 → adafruit_circuitpython_httpserver-4.8.3}/pyproject.toml +1 -1
- {adafruit_circuitpython_httpserver-4.8.1 → adafruit_circuitpython_httpserver-4.8.3}/.gitattributes +0 -0
- {adafruit_circuitpython_httpserver-4.8.1 → adafruit_circuitpython_httpserver-4.8.3}/.github/PULL_REQUEST_TEMPLATE/adafruit_circuitpython_pr.md +0 -0
- {adafruit_circuitpython_httpserver-4.8.1 → adafruit_circuitpython_httpserver-4.8.3}/.github/workflows/build.yml +0 -0
- {adafruit_circuitpython_httpserver-4.8.1 → adafruit_circuitpython_httpserver-4.8.3}/.github/workflows/failure-help-text.yml +0 -0
- {adafruit_circuitpython_httpserver-4.8.1 → adafruit_circuitpython_httpserver-4.8.3}/.github/workflows/release_gh.yml +0 -0
- {adafruit_circuitpython_httpserver-4.8.1 → adafruit_circuitpython_httpserver-4.8.3}/.github/workflows/release_pypi.yml +0 -0
- {adafruit_circuitpython_httpserver-4.8.1 → adafruit_circuitpython_httpserver-4.8.3}/.gitignore +0 -0
- {adafruit_circuitpython_httpserver-4.8.1 → adafruit_circuitpython_httpserver-4.8.3}/.readthedocs.yaml +0 -0
- {adafruit_circuitpython_httpserver-4.8.1 → adafruit_circuitpython_httpserver-4.8.3}/CODE_OF_CONDUCT.md +0 -0
- {adafruit_circuitpython_httpserver-4.8.1 → adafruit_circuitpython_httpserver-4.8.3}/LICENSE +0 -0
- {adafruit_circuitpython_httpserver-4.8.1 → adafruit_circuitpython_httpserver-4.8.3}/LICENSES/CC-BY-4.0.txt +0 -0
- {adafruit_circuitpython_httpserver-4.8.1 → adafruit_circuitpython_httpserver-4.8.3}/LICENSES/MIT.txt +0 -0
- {adafruit_circuitpython_httpserver-4.8.1 → adafruit_circuitpython_httpserver-4.8.3}/LICENSES/Unlicense.txt +0 -0
- {adafruit_circuitpython_httpserver-4.8.1 → adafruit_circuitpython_httpserver-4.8.3}/README.rst +0 -0
- {adafruit_circuitpython_httpserver-4.8.1 → adafruit_circuitpython_httpserver-4.8.3}/README.rst.license +0 -0
- {adafruit_circuitpython_httpserver-4.8.1 → adafruit_circuitpython_httpserver-4.8.3}/adafruit_circuitpython_httpserver.egg-info/SOURCES.txt +0 -0
- {adafruit_circuitpython_httpserver-4.8.1 → adafruit_circuitpython_httpserver-4.8.3}/adafruit_circuitpython_httpserver.egg-info/dependency_links.txt +0 -0
- {adafruit_circuitpython_httpserver-4.8.1 → adafruit_circuitpython_httpserver-4.8.3}/adafruit_circuitpython_httpserver.egg-info/requires.txt +0 -0
- {adafruit_circuitpython_httpserver-4.8.1 → adafruit_circuitpython_httpserver-4.8.3}/adafruit_circuitpython_httpserver.egg-info/top_level.txt +0 -0
- {adafruit_circuitpython_httpserver-4.8.1 → adafruit_circuitpython_httpserver-4.8.3}/adafruit_httpserver/authentication.py +0 -0
- {adafruit_circuitpython_httpserver-4.8.1 → adafruit_circuitpython_httpserver-4.8.3}/adafruit_httpserver/exceptions.py +0 -0
- {adafruit_circuitpython_httpserver-4.8.1 → adafruit_circuitpython_httpserver-4.8.3}/adafruit_httpserver/headers.py +0 -0
- {adafruit_circuitpython_httpserver-4.8.1 → adafruit_circuitpython_httpserver-4.8.3}/adafruit_httpserver/interfaces.py +0 -0
- {adafruit_circuitpython_httpserver-4.8.1 → adafruit_circuitpython_httpserver-4.8.3}/adafruit_httpserver/methods.py +0 -0
- {adafruit_circuitpython_httpserver-4.8.1 → adafruit_circuitpython_httpserver-4.8.3}/adafruit_httpserver/mime_types.py +0 -0
- {adafruit_circuitpython_httpserver-4.8.1 → adafruit_circuitpython_httpserver-4.8.3}/adafruit_httpserver/request.py +0 -0
- {adafruit_circuitpython_httpserver-4.8.1 → adafruit_circuitpython_httpserver-4.8.3}/adafruit_httpserver/response.py +0 -0
- {adafruit_circuitpython_httpserver-4.8.1 → adafruit_circuitpython_httpserver-4.8.3}/adafruit_httpserver/route.py +0 -0
- {adafruit_circuitpython_httpserver-4.8.1 → adafruit_circuitpython_httpserver-4.8.3}/adafruit_httpserver/status.py +0 -0
- {adafruit_circuitpython_httpserver-4.8.1 → adafruit_circuitpython_httpserver-4.8.3}/docs/_static/custom.css +0 -0
- {adafruit_circuitpython_httpserver-4.8.1 → adafruit_circuitpython_httpserver-4.8.3}/docs/_static/favicon.ico +0 -0
- {adafruit_circuitpython_httpserver-4.8.1 → adafruit_circuitpython_httpserver-4.8.3}/docs/_static/favicon.ico.license +0 -0
- {adafruit_circuitpython_httpserver-4.8.1 → adafruit_circuitpython_httpserver-4.8.3}/docs/api.rst +0 -0
- {adafruit_circuitpython_httpserver-4.8.1 → adafruit_circuitpython_httpserver-4.8.3}/docs/api.rst.license +0 -0
- {adafruit_circuitpython_httpserver-4.8.1 → adafruit_circuitpython_httpserver-4.8.3}/docs/conf.py +0 -0
- {adafruit_circuitpython_httpserver-4.8.1 → adafruit_circuitpython_httpserver-4.8.3}/docs/examples.rst +0 -0
- {adafruit_circuitpython_httpserver-4.8.1 → adafruit_circuitpython_httpserver-4.8.3}/docs/examples.rst.license +0 -0
- {adafruit_circuitpython_httpserver-4.8.1 → adafruit_circuitpython_httpserver-4.8.3}/docs/index.rst +0 -0
- {adafruit_circuitpython_httpserver-4.8.1 → adafruit_circuitpython_httpserver-4.8.3}/docs/index.rst.license +0 -0
- {adafruit_circuitpython_httpserver-4.8.1 → adafruit_circuitpython_httpserver-4.8.3}/docs/requirements.txt +0 -0
- {adafruit_circuitpython_httpserver-4.8.1 → adafruit_circuitpython_httpserver-4.8.3}/docs/starting_methods.rst +0 -0
- {adafruit_circuitpython_httpserver-4.8.1 → adafruit_circuitpython_httpserver-4.8.3}/docs/starting_methods.rst.license +0 -0
- {adafruit_circuitpython_httpserver-4.8.1 → adafruit_circuitpython_httpserver-4.8.3}/examples/directory_listing.tpl.html +0 -0
- {adafruit_circuitpython_httpserver-4.8.1 → adafruit_circuitpython_httpserver-4.8.3}/examples/home.html +0 -0
- {adafruit_circuitpython_httpserver-4.8.1 → adafruit_circuitpython_httpserver-4.8.3}/examples/httpserver_authentication_handlers.py +0 -0
- {adafruit_circuitpython_httpserver-4.8.1 → adafruit_circuitpython_httpserver-4.8.3}/examples/httpserver_authentication_server.py +0 -0
- {adafruit_circuitpython_httpserver-4.8.1 → adafruit_circuitpython_httpserver-4.8.3}/examples/httpserver_chunked.py +0 -0
- {adafruit_circuitpython_httpserver-4.8.1 → adafruit_circuitpython_httpserver-4.8.3}/examples/httpserver_cpu_information.py +0 -0
- {adafruit_circuitpython_httpserver-4.8.1 → adafruit_circuitpython_httpserver-4.8.3}/examples/httpserver_cpython.py +0 -0
- {adafruit_circuitpython_httpserver-4.8.1 → adafruit_circuitpython_httpserver-4.8.3}/examples/httpserver_form_data.py +0 -0
- {adafruit_circuitpython_httpserver-4.8.1 → adafruit_circuitpython_httpserver-4.8.3}/examples/httpserver_handler_serves_file.py +0 -0
- {adafruit_circuitpython_httpserver-4.8.1 → adafruit_circuitpython_httpserver-4.8.3}/examples/httpserver_https.py +0 -0
- {adafruit_circuitpython_httpserver-4.8.1 → adafruit_circuitpython_httpserver-4.8.3}/examples/httpserver_mdns.py +0 -0
- {adafruit_circuitpython_httpserver-4.8.1 → adafruit_circuitpython_httpserver-4.8.3}/examples/httpserver_methods.py +0 -0
- {adafruit_circuitpython_httpserver-4.8.1 → adafruit_circuitpython_httpserver-4.8.3}/examples/httpserver_multiple_servers.py +0 -0
- {adafruit_circuitpython_httpserver-4.8.1 → adafruit_circuitpython_httpserver-4.8.3}/examples/httpserver_neopixel.py +0 -0
- {adafruit_circuitpython_httpserver-4.8.1 → adafruit_circuitpython_httpserver-4.8.3}/examples/httpserver_redirects.py +0 -0
- {adafruit_circuitpython_httpserver-4.8.1 → adafruit_circuitpython_httpserver-4.8.3}/examples/httpserver_simpletest_auto_connection_manager.py +0 -0
- {adafruit_circuitpython_httpserver-4.8.1 → adafruit_circuitpython_httpserver-4.8.3}/examples/httpserver_simpletest_auto_settings_toml.py +0 -0
- {adafruit_circuitpython_httpserver-4.8.1 → adafruit_circuitpython_httpserver-4.8.3}/examples/httpserver_simpletest_manual_ap.py +0 -0
- {adafruit_circuitpython_httpserver-4.8.1 → adafruit_circuitpython_httpserver-4.8.3}/examples/httpserver_simpletest_manual_ethernet.py +0 -0
- {adafruit_circuitpython_httpserver-4.8.1 → adafruit_circuitpython_httpserver-4.8.3}/examples/httpserver_simpletest_manual_wifi.py +0 -0
- {adafruit_circuitpython_httpserver-4.8.1 → adafruit_circuitpython_httpserver-4.8.3}/examples/httpserver_sse.py +0 -0
- {adafruit_circuitpython_httpserver-4.8.1 → adafruit_circuitpython_httpserver-4.8.3}/examples/httpserver_start_and_poll.py +0 -0
- {adafruit_circuitpython_httpserver-4.8.1 → adafruit_circuitpython_httpserver-4.8.3}/examples/httpserver_start_and_poll_asyncio.py +0 -0
- {adafruit_circuitpython_httpserver-4.8.1 → adafruit_circuitpython_httpserver-4.8.3}/examples/httpserver_static_files_serving.py +0 -0
- {adafruit_circuitpython_httpserver-4.8.1 → adafruit_circuitpython_httpserver-4.8.3}/examples/httpserver_templates.py +0 -0
- {adafruit_circuitpython_httpserver-4.8.1 → adafruit_circuitpython_httpserver-4.8.3}/examples/httpserver_url_parameters.py +0 -0
- {adafruit_circuitpython_httpserver-4.8.1 → adafruit_circuitpython_httpserver-4.8.3}/examples/httpserver_video_stream.py +0 -0
- {adafruit_circuitpython_httpserver-4.8.1 → adafruit_circuitpython_httpserver-4.8.3}/examples/httpserver_websocket.py +0 -0
- {adafruit_circuitpython_httpserver-4.8.1 → adafruit_circuitpython_httpserver-4.8.3}/examples/settings.toml +0 -0
- {adafruit_circuitpython_httpserver-4.8.1 → adafruit_circuitpython_httpserver-4.8.3}/optional_requirements.txt +0 -0
- {adafruit_circuitpython_httpserver-4.8.1 → adafruit_circuitpython_httpserver-4.8.3}/requirements.txt +0 -0
- {adafruit_circuitpython_httpserver-4.8.1 → adafruit_circuitpython_httpserver-4.8.3}/ruff.toml +0 -0
- {adafruit_circuitpython_httpserver-4.8.1 → adafruit_circuitpython_httpserver-4.8.3}/setup.cfg +0 -0
|
@@ -53,6 +53,15 @@ REQUEST_HANDLED_RESPONSE_SENT = "request_handled_response_sent"
|
|
|
53
53
|
# CircuitPython does not have these error codes
|
|
54
54
|
MBEDTLS_ERR_SSL_FATAL_ALERT_MESSAGE = -30592
|
|
55
55
|
|
|
56
|
+
# Errors after which poll() closes the connection and returns NO_REQUEST.
|
|
57
|
+
#
|
|
58
|
+
# Built once here so poll() does not allocate a new tuple on every error.
|
|
59
|
+
_RETRYABLE_ERRNOS = (
|
|
60
|
+
EAGAIN, # No data available right now, try again later.
|
|
61
|
+
ECONNRESET, # Connection reset by peer, try again later.
|
|
62
|
+
MBEDTLS_ERR_SSL_FATAL_ALERT_MESSAGE, # Handshake failed, try again later.
|
|
63
|
+
)
|
|
64
|
+
|
|
56
65
|
|
|
57
66
|
class Server:
|
|
58
67
|
"""A basic socket-based HTTP server."""
|
|
@@ -326,6 +335,8 @@ class Server:
|
|
|
326
335
|
while b"\r\n\r\n" not in received_bytes:
|
|
327
336
|
try:
|
|
328
337
|
length = sock.recv_into(self._buffer, len(self._buffer))
|
|
338
|
+
if length == 0:
|
|
339
|
+
break
|
|
329
340
|
received_bytes += self._buffer[:length]
|
|
330
341
|
except TimeoutError:
|
|
331
342
|
break
|
|
@@ -347,6 +358,8 @@ class Server:
|
|
|
347
358
|
while len(received_body_bytes) < content_length:
|
|
348
359
|
try:
|
|
349
360
|
length = sock.recv_into(self._buffer, len(self._buffer))
|
|
361
|
+
if length == 0:
|
|
362
|
+
break
|
|
350
363
|
received_body_bytes += self._buffer[:length]
|
|
351
364
|
except TimeoutError:
|
|
352
365
|
break
|
|
@@ -508,22 +521,15 @@ class Server:
|
|
|
508
521
|
return REQUEST_HANDLED_RESPONSE_SENT
|
|
509
522
|
|
|
510
523
|
except Exception as error:
|
|
511
|
-
if isinstance(error, OSError)
|
|
512
|
-
#
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
return NO_REQUEST
|
|
521
|
-
|
|
522
|
-
# CPython specific SSL related errors
|
|
523
|
-
if implementation.name != "circuitpython" and isinstance(error, SSLError):
|
|
524
|
-
# Ignore unknown SSL certificate errors
|
|
525
|
-
if getattr(error, "reason", None) == "SSLV3_ALERT_CERTIFICATE_UNKNOWN":
|
|
526
|
-
return NO_REQUEST
|
|
524
|
+
if (isinstance(error, OSError) and error.errno in _RETRYABLE_ERRNOS) or (
|
|
525
|
+
# CPython-specific: ignore unknown SSL certificate errors.
|
|
526
|
+
implementation.name != "circuitpython"
|
|
527
|
+
and isinstance(error, SSLError)
|
|
528
|
+
and getattr(error, "reason", None) == "SSLV3_ALERT_CERTIFICATE_UNKNOWN"
|
|
529
|
+
):
|
|
530
|
+
if conn is not None:
|
|
531
|
+
conn.close()
|
|
532
|
+
return NO_REQUEST
|
|
527
533
|
|
|
528
534
|
if self.debug:
|
|
529
535
|
_debug_exception_in_handler(error)
|
|
@@ -34,14 +34,14 @@ def themed_template(user_preferred_theme: str):
|
|
|
34
34
|
<title>Cookie Example</title>
|
|
35
35
|
<style>
|
|
36
36
|
body {{
|
|
37
|
-
background-color: {theme[
|
|
38
|
-
color: {theme[
|
|
37
|
+
background-color: {theme["background-color"]};
|
|
38
|
+
color: {theme["color"]};
|
|
39
39
|
}}
|
|
40
40
|
|
|
41
41
|
button {{
|
|
42
|
-
background-color: {theme[
|
|
43
|
-
color: {theme[
|
|
44
|
-
border: 1px solid {theme[
|
|
42
|
+
background-color: {theme["button-color"]};
|
|
43
|
+
color: {theme["color"]};
|
|
44
|
+
border: 1px solid {theme["color"]};
|
|
45
45
|
padding: 10px;
|
|
46
46
|
margin: 10px;
|
|
47
47
|
}}
|
{adafruit_circuitpython_httpserver-4.8.1 → adafruit_circuitpython_httpserver-4.8.3}/pyproject.toml
RENAMED
|
@@ -12,7 +12,7 @@ requires = [
|
|
|
12
12
|
[project]
|
|
13
13
|
name = "adafruit-circuitpython-httpserver"
|
|
14
14
|
description = "Simple HTTP Server for CircuitPython"
|
|
15
|
-
version = "4.8.
|
|
15
|
+
version = "4.8.3"
|
|
16
16
|
readme = "README.rst"
|
|
17
17
|
authors = [
|
|
18
18
|
{name = "Adafruit Industries", email = "circuitpython@adafruit.com"}
|
{adafruit_circuitpython_httpserver-4.8.1 → adafruit_circuitpython_httpserver-4.8.3}/.gitattributes
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{adafruit_circuitpython_httpserver-4.8.1 → adafruit_circuitpython_httpserver-4.8.3}/.gitignore
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{adafruit_circuitpython_httpserver-4.8.1 → adafruit_circuitpython_httpserver-4.8.3}/LICENSES/MIT.txt
RENAMED
|
File without changes
|
|
File without changes
|
{adafruit_circuitpython_httpserver-4.8.1 → adafruit_circuitpython_httpserver-4.8.3}/README.rst
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{adafruit_circuitpython_httpserver-4.8.1 → adafruit_circuitpython_httpserver-4.8.3}/docs/api.rst
RENAMED
|
File without changes
|
|
File without changes
|
{adafruit_circuitpython_httpserver-4.8.1 → adafruit_circuitpython_httpserver-4.8.3}/docs/conf.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
{adafruit_circuitpython_httpserver-4.8.1 → adafruit_circuitpython_httpserver-4.8.3}/docs/index.rst
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{adafruit_circuitpython_httpserver-4.8.1 → adafruit_circuitpython_httpserver-4.8.3}/requirements.txt
RENAMED
|
File without changes
|
{adafruit_circuitpython_httpserver-4.8.1 → adafruit_circuitpython_httpserver-4.8.3}/ruff.toml
RENAMED
|
File without changes
|
{adafruit_circuitpython_httpserver-4.8.1 → adafruit_circuitpython_httpserver-4.8.3}/setup.cfg
RENAMED
|
File without changes
|