diff --git a/go.mod b/go.mod index be6e21e..31fbda4 100644 --- a/go.mod +++ b/go.mod @@ -5,7 +5,7 @@ go 1.24.0 toolchain go1.24.2 require ( - github.com/fox-toolkit/fox v0.27.0 + github.com/fox-toolkit/fox v0.27.1 github.com/stretchr/testify v1.11.1 ) diff --git a/go.sum b/go.sum index e3587c8..9e550b0 100644 --- a/go.sum +++ b/go.sum @@ -1,8 +1,8 @@ github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E= github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= -github.com/fox-toolkit/fox v0.27.0 h1:UWJWnBWiICZXUjatMKTm+VkQ1/1iSYerXnAdLNsprBk= -github.com/fox-toolkit/fox v0.27.0/go.mod h1:HouPMFaCy2U6iU2oztgiS62p7sX4NKhP4FnSZzvoqvk= +github.com/fox-toolkit/fox v0.27.1 h1:9D7qB41usalO4DyP/zLqy8nuCgrHUMydVUAeFJ6z1bw= +github.com/fox-toolkit/fox v0.27.1/go.mod h1:HouPMFaCy2U6iU2oztgiS62p7sX4NKhP4FnSZzvoqvk= github.com/google/gofuzz v1.2.0 h1:xRy4A+RhZaiKjJ1bPfwQ8sedCA+YS2YcCHW6ec7JMi0= github.com/google/gofuzz v1.2.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= github.com/kr/pretty v0.3.1 h1:flRD4NNwYAUpkphVc1HcthR4KEIFJ65n8Mw5qdRn3LE= diff --git a/options.go b/options.go index be85fe4..11c79be 100644 --- a/options.go +++ b/options.go @@ -26,13 +26,13 @@ func (f optionFunc) apply(c *config) { func defaultConfig() *config { return &config{ - resp: DefaultTimeoutResponse, + resp: DefaultResponse, } } // WithResponse sets a custom response handler function for the middleware. // This function will be invoked when a timeout occurs, allowing for custom responses -// to be sent back to the client. If not set, the middleware use [DefaultTimeoutResponse]. +// to be sent back to the client. If not set, the middleware use [DefaultResponse]. func WithResponse(h fox.HandlerFunc) Option { return optionFunc(func(c *config) { if h != nil { @@ -41,7 +41,7 @@ func WithResponse(h fox.HandlerFunc) Option { }) } -// DefaultTimeoutResponse sends a default 503 Service Unavailable response. -func DefaultTimeoutResponse(c *fox.Context) { +// DefaultResponse sends a default 503 Service Unavailable response. +func DefaultResponse(c *fox.Context) { http.Error(c.Writer(), http.StatusText(http.StatusServiceUnavailable), http.StatusServiceUnavailable) }