all repos — flounder @ e286a19d517d41e50443c3885ce8695878da32c0

A small site builder for the Gemini protocol

Fix line feeds in saved file
alex wennerberg alex@alexwennerberg.com
Sat, 05 Dec 2020 17:57:15 -0800
commit

e286a19d517d41e50443c3885ce8695878da32c0

parent

3d63a8ce4b80ae8cd81bff62ef03e4d4ea8b436f

1 files changed, 5 insertions(+), 1 deletions(-)

jump to
M http.gohttp.go

@@ -134,7 +134,11 @@ }

} else if r.Method == "POST" { // get post body r.ParseForm() - fileBytes := []byte(r.Form.Get("file_text")) + fileText := r.Form.Get("file_text") + // Web form by default gives us CR LF newlines. + // Unix files use just LF + fileText = strings.ReplaceAll(fileText, "\r\n", "\n") + fileBytes := []byte(fileText) err := checkIfValidFile(filePath, fileBytes) if err != nil { log.Println(err)