From 702c3dd7bdfe4fbbbf1f021da32692a16e447f1e Mon Sep 17 00:00:00 2001 From: Michael Lazar Date: Mon, 8 Jun 2020 13:46:49 -0400 Subject: [PATCH] Use a space character to separate the response status code from the meta string --- CHANGELOG.md | 4 +++- jetforce/protocol.py | 4 ++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index ec6646e..5afe36c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -8,7 +8,9 @@ This setting will define a language parameter that will be attached to the meta for all text/gemini responses. For example, ``--default-lang=en`` will set the response meta to ``"text/gemini; lang=en"``. -- Added definition for the "11 SENSITIVE INPUT" status code. +- Added support for the "11 SENSITIVE INPUT" status code. +- The response header now uses a instead of a to separate the + status code from the meta text. ### v0.3.2 diff --git a/jetforce/protocol.py b/jetforce/protocol.py index a0fab4a..c0cfd47 100644 --- a/jetforce/protocol.py +++ b/jetforce/protocol.py @@ -183,7 +183,7 @@ class GeminiProtocol(LineOnlyReceiver): Write the gemini status line to an internal buffer. The status line is a single UTF-8 line formatted as: - \t\r\n + If the response status is 2, the meta field will contain the mimetype of the response data sent. If the status is something else, the meta @@ -195,7 +195,7 @@ class GeminiProtocol(LineOnlyReceiver): """ self.status = status self.meta = meta - self.response_buffer = f"{status}\t{meta}\r\n" + self.response_buffer = f"{status} {meta}\r\n" def write_body(self, data: typing.Union[str, bytes]) -> None: """