mirror of
https://github.com/infinite-iroha/touka.git
synced 2026-02-03 00:41:10 +08:00
commit
2c60e84067
3 changed files with 9 additions and 13 deletions
|
|
@ -7,7 +7,6 @@ package touka
|
|||
import (
|
||||
"context"
|
||||
"errors"
|
||||
"log"
|
||||
"reflect"
|
||||
"runtime"
|
||||
"strings"
|
||||
|
|
@ -148,7 +147,7 @@ func defaultErrorWarp(handler ErrorHandler) ErrorHandler {
|
|||
return
|
||||
default:
|
||||
if c.Writer.Written() {
|
||||
log.Printf("errpage: response already started for status %d, skipping error page rendering, err: %v", code, err)
|
||||
c.Debugf("errpage: response already started for status %d, skipping error page rendering, err: %v", code, err)
|
||||
return
|
||||
}
|
||||
}
|
||||
|
|
@ -163,7 +162,7 @@ func defaultErrorWarp(handler ErrorHandler) ErrorHandler {
|
|||
// 避免在客户端已关闭连接后写入响应导致的问题
|
||||
// 检查 context.Context 是否已取消
|
||||
if errors.Is(c.Request.Context().Err(), context.Canceled) {
|
||||
log.Printf("errpage: client disconnected, skipping error page rendering for status %d, err: %v", code, err)
|
||||
c.Debugf("errpage: client disconnected, skipping error page rendering for status %d, err: %v", code, err)
|
||||
return
|
||||
}
|
||||
|
||||
|
|
|
|||
7
go.mod
7
go.mod
|
|
@ -1,16 +1,15 @@
|
|||
module github.com/infinite-iroha/touka
|
||||
|
||||
go 1.24.4
|
||||
go 1.24.5
|
||||
|
||||
require (
|
||||
github.com/WJQSERVER-STUDIO/go-utils/iox v0.0.2
|
||||
github.com/WJQSERVER-STUDIO/httpc v0.8.1
|
||||
github.com/WJQSERVER-STUDIO/httpc v0.8.2
|
||||
github.com/fenthope/reco v0.0.3
|
||||
github.com/go-json-experiment/json v0.0.0-20250714165856-be8212f5270d
|
||||
github.com/go-json-experiment/json v0.0.0-20250725192818-e39067aee2d2
|
||||
)
|
||||
|
||||
require (
|
||||
github.com/WJQSERVER-STUDIO/go-utils/copyb v0.0.6 // indirect
|
||||
github.com/valyala/bytebufferpool v1.0.0 // indirect
|
||||
golang.org/x/net v0.42.0 // indirect
|
||||
)
|
||||
|
|
|
|||
10
go.sum
10
go.sum
|
|
@ -1,13 +1,11 @@
|
|||
github.com/WJQSERVER-STUDIO/go-utils/copyb v0.0.6 h1:/50VJYXd6jcu+p5BnEBDyiX0nAyGxas1W3DCnrYMxMY=
|
||||
github.com/WJQSERVER-STUDIO/go-utils/copyb v0.0.6/go.mod h1:FZ6XE+4TKy4MOfX1xWKe6Rwsg0ucYFCdNh1KLvyKTfc=
|
||||
github.com/WJQSERVER-STUDIO/go-utils/iox v0.0.2 h1:AiIHXP21LpK7pFfqUlUstgQEWzjbekZgxOuvVwiMfyM=
|
||||
github.com/WJQSERVER-STUDIO/go-utils/iox v0.0.2/go.mod h1:mCLqYU32bTmEE6dpj37MKKiZgz70Jh/xyK9vVbq6pok=
|
||||
github.com/WJQSERVER-STUDIO/httpc v0.8.1 h1:/eG8aYKL3WfQILIRbG+cbzQjPkNHEPTqfGUdQS5rtI4=
|
||||
github.com/WJQSERVER-STUDIO/httpc v0.8.1/go.mod h1:mxXBf2hqbQGNHkVy/7wfU7Xi2s09MyZpbY2hyR+4uD4=
|
||||
github.com/WJQSERVER-STUDIO/httpc v0.8.2 h1:PFPLodV0QAfGEP6915J57vIqoKu9cGuuiXG/7C9TNUk=
|
||||
github.com/WJQSERVER-STUDIO/httpc v0.8.2/go.mod h1:8WhHVRO+olDFBSvL5PC/bdMkb6U3vRdPJ4p4pnguV5Y=
|
||||
github.com/fenthope/reco v0.0.3 h1:RmnQ0D9a8PWtwOODawitTe4BztTnS9wYwrDbipISNq4=
|
||||
github.com/fenthope/reco v0.0.3/go.mod h1:mDkGLHte5udWTIcjQTxrABRcf56SSdxBOCLgrRDwI/Y=
|
||||
github.com/go-json-experiment/json v0.0.0-20250714165856-be8212f5270d h1:+d6m5Bjvv0/RJct1VcOw2P5bvBOGjENmxORJYnSYDow=
|
||||
github.com/go-json-experiment/json v0.0.0-20250714165856-be8212f5270d/go.mod h1:TiCD2a1pcmjd7YnhGH0f/zKNcCD06B029pHhzV23c2M=
|
||||
github.com/go-json-experiment/json v0.0.0-20250725192818-e39067aee2d2 h1:iizUGZ9pEquQS5jTGkh4AqeeHCMbfbjeb0zMt0aEFzs=
|
||||
github.com/go-json-experiment/json v0.0.0-20250725192818-e39067aee2d2/go.mod h1:TiCD2a1pcmjd7YnhGH0f/zKNcCD06B029pHhzV23c2M=
|
||||
github.com/valyala/bytebufferpool v1.0.0 h1:GqA5TC/0021Y/b9FG4Oi9Mr3q7XYx6KllzawFIhcdPw=
|
||||
github.com/valyala/bytebufferpool v1.0.0/go.mod h1:6bBcMArwyJ5K/AmCkWv1jt77kVWyCJ6HpOuEn7z0Csc=
|
||||
golang.org/x/net v0.42.0 h1:jzkYrhi3YQWD6MLBJcsklgQsoAcw89EcZbJw8Z614hs=
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue