// // GeminiRequest.swift // Gemini // // Created by Shadowfacts on 7/12/20. // import Foundation public struct GeminiRequest { public let url: URL public init(url: URL) throws { if url.absoluteString.count > 1024 { throw Error.urlTooLong } self.url = url } var data: Data { var data = url.absoluteString.data(using: .utf8)! data.append(contentsOf: [13, 10]) // return data } } public extension GeminiRequest { enum Error: Swift.Error { case urlTooLong } }