build: refactor makefile

This commit is contained in:
Oleg Lobanov committed 2021-12-20 23:36:50 +01:00
1 parent b1e0d5b39f
commit f81857acce
15 files changed
+3333 -87

No files matched your search

+6 -5
View File
@@ -64,15 +64,16 @@ func handle(fn handleFunc, prefix string, store *storage.Storage, server *settin
server: server,
})
if status != 0 {
txt := http.StatusText(status)
http.Error(w, strconv.Itoa(status)+" "+txt, status)
}
if status >= 400 || err != nil {
clientIP := realip.FromRequest(r)
log.Printf("%s: %v %s %v", r.URL.Path, status, clientIP, err)
}
if status != 0 {
txt := http.StatusText(status)
http.Error(w, strconv.Itoa(status)+" "+txt, status)
return
}
})
return stripPrefix(prefix, handler)
+1 -1
View File
@@ -110,7 +110,7 @@ func TestPublicShareHandlerAuthentication(t *testing.T) {
func newHTTPRequest(t *testing.T, requestModifiers ...func(*http.Request)) *http.Request {
t.Helper()
r, err := http.NewRequest(http.MethodGet, "h", nil)
r, err := http.NewRequest(http.MethodGet, "h", http.NoBody)
if err != nil {
t.Fatalf("failed to construct request: %v", err)
}