change newlines to be MS-DOS style

This commit is contained in:
Reese Norris
2024-10-13 11:36:44 -07:00
parent dbd055a3ee
commit fa9327321d
2 changed files with 15 additions and 2 deletions

View File

@@ -37,7 +37,14 @@ func formatServerListTxt() string {
}
serversList := fmt.Sprintf("OPENFSD:%s:Everywhere:OPENFSD:1:", domainName)
return strings.Replace(serverlistTextFormat, "{SERVERS_LIST}", serversList, -1)
// Format with built server list
formatted := strings.Replace(serverlistTextFormat, "{SERVERS_LIST}", serversList, -1)
// Ensure all line feeds also have carriage returns
formatted = strings.Replace(formatted, "\n", "\r\n", -1)
return formatted
}
var formattedServerListTxtEtag string

View File

@@ -37,7 +37,13 @@ func formatStatusTxt() string {
openfsdAddress += servercontext.Config().DomainName
}
return strings.Replace(statusFormat, "{OPENFSD_ADDRESS}", openfsdAddress, -1)
// Format string with {OPENFSD_ADDRESS}
formatted := strings.Replace(statusFormat, "{OPENFSD_ADDRESS}", openfsdAddress, -1)
// Ensure all line feeds also have carriage returns
formatted = strings.Replace(formatted, "\n", "\r\n", -1)
return formatted
}
var formattedStatusTxtEtag string