aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNavan Chauhan <navanchauhan@gmail.com>2023-12-09 17:34:26 -0700
committerNavan Chauhan <navanchauhan@gmail.com>2023-12-09 17:34:26 -0700
commitcfae29a68f8ae5e2ba5feeea24e3943e87b04a22 (patch)
tree6234e8c3c62d08d7e2c5788b71b2b71f2a023c5b
parent4de1822fac59b0daf9b741bbf16b386b5c83ec5e (diff)
Fix comments not displaying on some clients
-rw-r--r--Sources/Helpers.swift4
-rw-r--r--Sources/gopherHandler.swift4
-rw-r--r--example-gopherdata/gophermap2
3 files changed, 5 insertions, 5 deletions
diff --git a/Sources/Helpers.swift b/Sources/Helpers.swift
index 8481347..caf841b 100644
--- a/Sources/Helpers.swift
+++ b/Sources/Helpers.swift
@@ -3,7 +3,7 @@ import Foundation
let versionString = "generated and served by swift-gopher/1.0.0" // TODO: Handle automatic versioning
func buildVersionStringResponse() -> String {
- let repeatedString = "i" + String(repeating: "-", count: 80) + "\terror.host\t1\r\n"
- let versionResponseString = "i" + String(repeating: " ", count: 80 - versionString.count) + versionString + "\terror.host\t1\r\n"
+ let repeatedString = "i" + String(repeating: "-", count: 80) + "\t\terror.host\t1\r\n"
+ let versionResponseString = "i" + String(repeating: " ", count: 80 - versionString.count) + versionString + "\t\terror.host\t1\r\n"
return "\(repeatedString)\(versionResponseString)"
} \ No newline at end of file
diff --git a/Sources/gopherHandler.swift b/Sources/gopherHandler.swift
index 1961a8f..fb2c4c7 100644
--- a/Sources/gopherHandler.swift
+++ b/Sources/gopherHandler.swift
@@ -176,7 +176,7 @@ final class GopherHandler: ChannelInboundHandler {
line = String(line.dropLast())
}
if line.prefix(1) == "i" {
- gopherResponse.append("\(line)\terror.host\t1\r\n")
+ gopherResponse.append("\(line)\t\terror.host\t1\r\n")
continue
}
@@ -212,7 +212,7 @@ final class GopherHandler: ChannelInboundHandler {
gopherResponse.append(item_line)
} else {
line = line.replacingOccurrences(of: "\n", with: "")
- gopherResponse.append("i\(line)\terror.host\t1\r\n")
+ gopherResponse.append("i\(line)\t\terror.host\t1\r\n")
}
}
} else {
diff --git a/example-gopherdata/gophermap b/example-gopherdata/gophermap
index ada23a6..1047743 100644
--- a/example-gopherdata/gophermap
+++ b/example-gopherdata/gophermap
@@ -20,7 +20,7 @@
`"Y88888P" `"YbbdP"' 88`YbbdP"' 88 88 `"Ybbd8"' 88
88
88
-i Welcome to your Gopherspace!
+iWelcome to your Gopherspace!
1example /example localhost 8080
0hello_world.txt /hello_world.txt localhost 8080
1Other Gopher servers in the world (via Floodgap) /world gopher.floodgap.com 70 \ No newline at end of file