v1.27.0-a #10

Closed
jonathanface wants to merge 473 commits from v1.27.0-a into master
Showing only changes of commit 56bbeb01af - Show all commits

View File

@ -56,15 +56,15 @@ func GetSrv(ctx context.Context, deps *deps.Deps) (*http.Server, error) {
file, err := static.Open(path.Join(basePath, r.URL.Path)[1:]) file, err := static.Open(path.Join(basePath, r.URL.Path)[1:])
if err != nil { if err != nil {
w.WriteHeader(http.StatusNotFound) w.WriteHeader(http.StatusNotFound)
w.Write([]byte("404 Not Found")) _, _ = w.Write([]byte("404 Not Found"))
return return
} }
defer file.Close() defer func() { _ = file.Close() }()
fileInfo, err := file.Stat() fileInfo, err := file.Stat()
if err != nil { if err != nil {
w.WriteHeader(http.StatusInternalServerError) w.WriteHeader(http.StatusInternalServerError)
w.Write([]byte("500 Internal Server Error")) _, _ = w.Write([]byte("500 Internal Server Error"))
return return
} }