config/mimetypes

Types

MimeTypes = object
  t*: MimeTypesTable
  image*: Table[string, string]
MimeTypesTable = Table[string, string]

Consts

DefaultGuess = (data: [(53519468238506303, "uri", "text/uri-list"),
                       (-6726472391950350143, "html", "text/html"),
                       (9107636633855404481, "txt", "text/plain"),
                       (-4461516501012363133, "gif", "image/gif"),
                       (8404884882207723585, "jpg", "image/jpeg"),
                       (989828783378469887, "png", "image/png"),
                       (7790191541339128006, "xhtm", "application/xhtml+xml"),
                       (0, "", ""), (0, "", ""),
                       (8511392467248848841, "css", "text/css"), (0, "", ""),
                       (0, "", ""),
                       (-6974935617144361908, "jfif", "image/jpeg"),
                       (-7854192451770849459, "asc", "text/x-ansi"),
                       (0, "", ""), (0, "", ""), (0, "", ""),
                       (-224110694177604591, "bmp", "image/bmp"), (0, "", ""),
                       (83932229904883027, "gmi", "text/gemini"), (
    -7229996896001644396, "xhtml", "application/xhtml+xml"), (0, "", ""),
                       (0, "", ""), (0, "", ""), (0, "", ""),
                       (630863466902641369, "xht", "application/xhtml+xml"),
                       (-4187795053925063398, "md", "text/markdown"),
                       (0, "", ""), (0, "", ""), (0, "", ""), (0, "", ""),
                       (0, "", ""), (0, "", ""),
                       (-3582453853168848351, "jpeg", "image/jpeg"),
                       (3633115315158897761, "svg", "image/svg+xml"),
                       (0, "", ""), (0, "", ""),
                       (-2731885446648872859, "jpe", "image/jpeg"),
                       (0, "", ""), (0, "", ""), (0, "", ""),
                       (-2626096905390814679, "htm", "text/html"), (0, "", ""),
                       (0, "", ""), (0, "", ""), (0, "", ""), (0, "", ""),
                       (1338573772714730223, "webp", "image/webp"),
                       (0, "", ""), (0, "", ""), (0, "", ""), (0, "", ""),
                       (0, "", ""), (0, "", ""), (0, "", ""), (0, "", ""),
                       (0, "", ""), (0, "", ""), (0, "", ""), (0, "", ""),
                       (0, "", ""), (0, "", ""), (0, "", ""),
                       (-7632904375731387521, "ans", "text/x-ansi")],
                counter: 21)

Procs

proc guessContentType(mimeTypes: MimeTypesTable; path: string;
                      fallback = "application/octet-stream"): string {.
    ...raises: [], tags: [], forbids: [].}
proc isJavaScriptType(s: string): bool {....raises: [], tags: [], forbids: [].}
proc isTextType(s: string): bool {....raises: [], tags: [], forbids: [].}
proc parseMimeTypes(mimeTypes: var MimeTypes; file: ChaFile): Opt[void] {.
    ...raises: [], tags: [], forbids: [].}