flounder

A simple gemini site builder
Log | Files | Refs | README | LICENSE

commit 408fee59c53437baa690c4a98b516baea98078e0
parent 133901b496410a2adc16946945095c77be961f7b
Author: alex wennerberg <alex@alexwennerberg.com>
Date:   Wed,  3 Nov 2021 18:37:50 -0700

Strip out BOM (byte-order mark)

Diffstat:
Mhttp.go | 1+
1 file changed, 1 insertion(+), 0 deletions(-)

diff --git a/http.go b/http.go @@ -162,6 +162,7 @@ func editFileHandler(w http.ResponseWriter, r *http.Request) { // Unix files use just LF fileText = strings.ReplaceAll(fileText, "\r\n", "\n") fileBytes := []byte(fileText) + fileBytes = bytes.Trim(fileBytes, "\xef\xbb\xbf") // Remove BOM err := checkIfValidFile(user.Username, filePath, fileBytes) if err != nil { log.Println(err)