Skip to content

Commit 90acc5f

Browse files
committed
返回标准http错误、
1 parent 06416eb commit 90acc5f

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

http/server/handler.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -297,7 +297,7 @@ func (s *httpServer) ServeHTTP(w http.ResponseWriter, r *http.Request) {
297297
h, ctx := getHandler(r.Method, r.URL.Path)
298298
if h == nil {
299299
log.Errorf("%v %v %v not found.", r.RemoteAddr, r.Method, r.URL)
300-
SendResponse(w, http.StatusNotFound, "invalid request")
300+
w.WriteHeader(http.StatusNotFound)
301301
return
302302
}
303303

log/writer.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -129,9 +129,9 @@ func (l *Logger) rotate(now time.Time) {
129129
}
130130

131131
func (l *Logger) write(t Level, format string, argv ...interface{}) {
132-
if l == nil {
133-
return
134-
}
132+
if l == nil {
133+
return
134+
}
135135
if t > l.level {
136136
return
137137
}

0 commit comments

Comments
 (0)