Do not crash if os.Stat returns an error other than not found or no permission, which seems to mysteriously happen sometimes...

This commit is contained in:
Solderpunk 2020-06-01 21:27:15 +02:00
parent 5fdb3622e9
commit 9c51f26d74
1 changed files with 4 additions and 0 deletions

View File

@ -94,6 +94,10 @@ func handleGeminiRequest(conn net.Conn, config Config, logEntries chan LogEntry)
conn.Write([]byte("51 Not found!\r\n"))
log.Status = 51
return
} else if err != nil {
conn.Write([]byte("40 Temporaray failure!\r\n"))
log.Status = 40
return
}
// Handle URLS which map to a directory