From b89c980ee13eafe0b14202e40617d4ed3c2262f7 Mon Sep 17 00:00:00 2001 From: Navan Chauhan Date: Fri, 22 Dec 2023 20:45:04 -0700 Subject: add URL: redirect to server --- Sources/swift-gopher/gopherHandler.swift | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'Sources') diff --git a/Sources/swift-gopher/gopherHandler.swift b/Sources/swift-gopher/gopherHandler.swift index cd150e3..0ac5c31 100644 --- a/Sources/swift-gopher/gopherHandler.swift +++ b/Sources/swift-gopher/gopherHandler.swift @@ -334,6 +334,14 @@ final class GopherHandler: ChannelInboundHandler { return .string(prepareGopherMenu(path: preparePath())) } + // Check if request is an HTTP url + if request.hasPrefix("URL:") { + let url = String(request.dropFirst(4)) + return .string( + "" + ) + } + // Again, fix for the iOS client. Might as well make my own client if request.hasSuffix("\n") { request = String(request.dropLast()) -- cgit v1.2.3