[ANN] twins, a Gemini server written in Go

John Cowan cowan at ccil.org
Mon Nov 9 04:41:06 GMT 2020


On Sat, Nov 7, 2020 at 12:17 AM Sean Conner <sean at conman.org> wrote:

So what are the standard MIME parameters for text/plain?


If you go to <https://www.iana.org/assignments/media-types/media-types.xhtml>,
the IANA registration for MIME-types, you'll find links under text/plain to
RFCs 2046 (optional charset parameter), 3676 (optional format and delsp
parameters), and 5147 (not sure why it's here; no parameters).

text/markdown?
>

The same process gets you to RFC 7763 (mandatory charset, optional variant).

text/html?


Charset (optional).

> multipart/alternate?


Boundary (required)

> And what should a client do when it
> encounters a non-standard MIME parameter?
>

Ah.  Now that's from RFC 2045:

   Parameters are modifiers of the media subtype, and as such do not
   fundamentally affect the nature of the content.  The set of
   meaningful parameters depends on the media type and subtype.  Most
   parameters are associated with a single specific subtype.  However, a
   given top-level media type may define parameters which are applicable
   to any subtype of that type.  Parameters may be required by their
   defining media type or subtype or they may be optional.  MIME
   implementations must also ignore any parameters whose names they do
   not recognize.

The last sentence is the critical one.  Add any parameters you want,
because clients must ignore them.

As for parsing, per RFC 2045 just use split() to split by semicolons; the
first result is the type/subtype, and on each of the rest, strip out all
spaces and then split them on the equal sign to separate name from value.



John Cowan          http://vrici.lojban.org/~cowan        cowan at ccil.org
Do what you will / this Life's a Fiction
And is made up of / Contradiction.  --William Blake
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.orbitalfox.eu/archives/gemini/attachments/20201108/6d29b6f6/attachment.htm>


More information about the Gemini mailing list