diff --git a/dynamic.go b/dynamic.go index d451173..26272d0 100644 --- a/dynamic.go +++ b/dynamic.go @@ -29,13 +29,13 @@ func handleCGI(config Config, path string, URL *url.URL, log *LogEntry, errorLog } response, err := cmd.Output() if ctx.Err() == context.DeadlineExceeded { - errorLog <- "Terminating CGI process " + path + " due to exceeding 10 second runtime limit." + errorLog <- "Terminating CGI process " + path + " due to exceeding 10 second runtime limit." conn.Write([]byte("42 CGI process timed out!\r\n")) log.Status = 42 return } if err != nil { - errorLog <- "Error starting CGI executable " + path + ": " + err.Error() + errorLog <- "Error starting CGI executable " + path + ": " + err.Error() conn.Write([]byte("42 CGI error!\r\n")) log.Status = 42 return @@ -44,7 +44,7 @@ func handleCGI(config Config, path string, URL *url.URL, log *LogEntry, errorLog header, _, err := bufio.NewReader(strings.NewReader(string(response))).ReadLine() status, err2 := strconv.Atoi(strings.Fields(string(header))[0]) if err != nil || err2 != nil { - errorLog <- "Unable to parse first line of output from CGI process " + path + " as valid Gemini response header." + errorLog <- "Unable to parse first line of output from CGI process " + path + " as valid Gemini response header." conn.Write([]byte("42 CGI error!\r\n")) log.Status = 42 return diff --git a/handler.go b/handler.go index acec76a..8dc90a6 100644 --- a/handler.go +++ b/handler.go @@ -102,10 +102,10 @@ func handleGeminiRequest(conn net.Conn, config Config, accessLogEntries chan Log authorised = false for _, clientCert := range clientCerts { for _, allowedFingerprint := range allowedFingerprints { - if getCertFingerprint(clientCert) == allowedFingerprint { - authorised = true - break - } + if getCertFingerprint(clientCert) == allowedFingerprint { + authorised = true + break + } } } } @@ -300,7 +300,7 @@ func parseMollyFiles(path string, info os.FileInfo, config *Config, errorLogEntr config.DirectoryReverse = mollyFile.DirectoryReverse config.DirectoryTitles = mollyFile.DirectoryTitles for pathRegex, newType := range mollyFile.MimeOverrides { - config.MimeOverrides[pathRegex] = newType + config.MimeOverrides[pathRegex] = newType } } } diff --git a/main.go b/main.go index 2aae31a..cb6316e 100644 --- a/main.go +++ b/main.go @@ -60,15 +60,15 @@ func main() { accessLogEntries := make(chan LogEntry, 10) go func() { for { - entry := <- accessLogEntries + entry := <-accessLogEntries writeLogEntry(accessLogFile, entry) } }() errorLogEntries := make(chan string, 10) go func() { for { - message := <- errorLogEntries - errorLogFile.WriteString( time.Now().Format(time.RFC3339) + " " + message + "\n") + message := <-errorLogEntries + errorLogFile.WriteString(time.Now().Format(time.RFC3339) + " " + message + "\n") } }()