From bb9c5735dbb554a92f24b1fb8b941d87e8e788b5 Mon Sep 17 00:00:00 2001

From: =?UTF-8?q?Jaakko=20Kera=CC=88nen?= jaakko.keranen@iki.fi

Date: Sun, 11 Dec 2022 11:01:42 +0200

Subject: [PATCH 1/1] Report Unicode decode error to client


README.md | 1 +

gmcapsule/gemini.py | 36 ++++++++++++++++++++----------------

2 files changed, 21 insertions(+), 16 deletions(-)

diff --git a/README.md b/README.md

index a1af4b9..80b3f0a 100644

--- a/README.md

+++ b/README.md

@@ -48,6 +48,7 @@ The log can be viewed via journalctl (or syslog):

v0.2.3

+* Respond with an error code to malformed UTF-8 in the request.

v0.2.2

diff --git a/gmcapsule/gemini.py b/gmcapsule/gemini.py

index b086ec6..34ac7f6 100644

--- a/gmcapsule/gemini.py

+++ b/gmcapsule/gemini.py

@@ -376,22 +376,26 @@ class Worker(threading.Thread):

     req_mime = None

     incoming = safe_recv(stream, MAX_RECV)

     if not request or len(data) > MAX_RECV:

         report_error(stream, 59, "Invalid request")

--

2.25.1

Proxy Information
Original URL
gemini://git.skyjake.fi/gmcapsule/main/patch/bb9c5735dbb554a92f24b1fb8b941d87e8e788b5.patch
Status Code
Success (20)
Meta
text/plain
Capsule Response Time
30.765347 milliseconds
Gemini-to-HTML Time
0.887359 milliseconds

This content has been proxied by September (ba2dc).