swiftgemini

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

commit 0dd32ee9faaf96d9d294faaa14115ea20f2392d8
parent 219cdb37a5b7663dbb62c636b4151d67df50ccdf
Author: FIGBERT <figbert@figbert.com>
Date:   Sun, 24 Jul 2022 16:24:12 -0700

Improve spec compliance

The "gemini" scheme is no longer mandated, which enables inter-protocol
proxying by Gemini servers, and the host portion of the URL is required.

Diffstat:
MSources/SwiftGemini/SwiftGemini.swift | 5++---
1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/Sources/SwiftGemini/SwiftGemini.swift b/Sources/SwiftGemini/SwiftGemini.swift @@ -13,9 +13,8 @@ class GeminiRequest { var gemtext: String? init?(_ url: URL) throws { - guard url.scheme == "gemini", - url.user == nil && url.password == nil, - url.absoluteString.data(using: .utf8)!.count <= 1024 else { return nil } + guard url.user == nil && url.password == nil, + url.host != nil && url.absoluteString.data(using: .utf8)!.count <= 1024 else { return nil } self.url = url request() }