swiftgemini

[ACTIVE] gemini protocol in swift
git clone git://git.figbert.com/swiftgemini.git
Log | Files | Refs | README

commit 6680ed18569dfeff55a38bc168b1d4f0295ed216
parent d281fb4004df74f9a7fb9e7fde06ae124dee5cf2
Author: FIGBERT <figbert@figbert.com>
Date:   Sun, 24 Jul 2022 19:08:10 -0700

Default to UTF-8 gemtext if MIME is empty

Diffstat:
MSources/SwiftGemini/SwiftGemini.swift | 2+-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/Sources/SwiftGemini/SwiftGemini.swift b/Sources/SwiftGemini/SwiftGemini.swift @@ -77,7 +77,7 @@ class GeminiRequest { let ix = self.response!.firstIndex(of: 13)! + 2 let body = self.response!.suffix(from: ix) - if case let .MIME(mime) = self.meta, mime.hasPrefix("text/gemini") { + if case let .MIME(mime) = self.meta, mime.hasPrefix("text/gemini") || mime.isEmpty { self.gemtext = String(data: body, encoding: .utf8) } else { self.body = body