aboutsummaryrefslogtreecommitdiff
path: root/Sources/Helpers.swift
diff options
context:
space:
mode:
authorNavan Chauhan <navanchauhan@gmail.com>2023-12-09 15:57:59 -0700
committerNavan Chauhan <navanchauhan@gmail.com>2023-12-09 15:57:59 -0700
commit81f90e6340e84027bb62a15f8fa5048da9842b32 (patch)
tree449398c5e8f002e59673651c9515cc19b7dada30 /Sources/Helpers.swift
parent3d4d8ff25b4ef0b2c162528ece906fd463d170e4 (diff)
added version string to response
Diffstat (limited to 'Sources/Helpers.swift')
-rw-r--r--Sources/Helpers.swift8
1 files changed, 8 insertions, 0 deletions
diff --git a/Sources/Helpers.swift b/Sources/Helpers.swift
index fecc4ab..8481347 100644
--- a/Sources/Helpers.swift
+++ b/Sources/Helpers.swift
@@ -1 +1,9 @@
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"
+ return "\(repeatedString)\(versionResponseString)"
+} \ No newline at end of file