Use a space character to separate the response status code from the meta string

This commit is contained in:
Michael Lazar 2020-06-08 13:46:49 -04:00
parent 218fc2af53
commit 702c3dd7bd
2 changed files with 5 additions and 3 deletions

View File

@ -8,7 +8,9 @@
This setting will define a language parameter that will be attached to the 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 meta for all text/gemini responses. For example, ``--default-lang=en`` will
set the response meta to ``"text/gemini; lang=en"``. 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 <space> instead of a <tab> to separate the
status code from the meta text.
### v0.3.2 ### v0.3.2

View File

@ -183,7 +183,7 @@ class GeminiProtocol(LineOnlyReceiver):
Write the gemini status line to an internal buffer. Write the gemini status line to an internal buffer.
The status line is a single UTF-8 line formatted as: The status line is a single UTF-8 line formatted as:
<code>\t<meta>\r\n <STATUS><SPACE><META><CR><LF>
If the response status is 2, the meta field will contain the mimetype 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 of the response data sent. If the status is something else, the meta
@ -195,7 +195,7 @@ class GeminiProtocol(LineOnlyReceiver):
""" """
self.status = status self.status = status
self.meta = meta 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: def write_body(self, data: typing.Union[str, bytes]) -> None:
""" """