mirror of
https://github.com/kataras/iris.git
synced 2026-01-03 10:17:03 +00:00
add human-friendly middleware names on route debugging (see HISTORY.md#Next)
Former-commit-id: f7291c4a077c4d1573344c93ba8a153fede18795
This commit is contained in:
@@ -12,6 +12,10 @@ import (
|
||||
"github.com/kataras/iris/v12/context"
|
||||
)
|
||||
|
||||
func init() {
|
||||
context.SetHandlerName("iris/middleware/basicauth.*", "Basic Authentication")
|
||||
}
|
||||
|
||||
type (
|
||||
encodedUser struct {
|
||||
HeaderValue string
|
||||
|
||||
@@ -10,6 +10,10 @@ import (
|
||||
"github.com/kataras/iris/v12/context"
|
||||
)
|
||||
|
||||
func init() {
|
||||
context.SetHandlerName("iris/middleware/hcaptcha.*", "hCaptcha")
|
||||
}
|
||||
|
||||
var (
|
||||
// ResponseContextKey is the default request's context key that response of a hcaptcha request is kept.
|
||||
ResponseContextKey string = "iris.hcaptcha"
|
||||
|
||||
@@ -11,6 +11,10 @@ import (
|
||||
"github.com/kataras/iris/v12/core/handlerconv"
|
||||
)
|
||||
|
||||
func init() {
|
||||
context.SetHandlerName("iris/middleware/pprof.*", "Profiling")
|
||||
}
|
||||
|
||||
// New returns a new pprof (profile, cmdline, symbol, goroutine, heap, threadcreate, debug/block) Middleware.
|
||||
// Note: Route MUST have the last named parameter wildcard named '{action:path}'
|
||||
func New() context.Handler {
|
||||
|
||||
@@ -11,6 +11,10 @@ import (
|
||||
"github.com/kataras/iris/v12/core/netutil"
|
||||
)
|
||||
|
||||
func init() {
|
||||
context.SetHandlerName("iris/middleware/recaptcha.*", "reCAPTCHA")
|
||||
}
|
||||
|
||||
const (
|
||||
// responseFormValue = "g-recaptcha-response"
|
||||
apiURL = "https://www.google.com/recaptcha/api/siteverify"
|
||||
|
||||
@@ -9,6 +9,10 @@ import (
|
||||
"github.com/kataras/iris/v12/context"
|
||||
)
|
||||
|
||||
func init() {
|
||||
context.SetHandlerName("iris/middleware/recover.*", "Panic Recover")
|
||||
}
|
||||
|
||||
func getRequestLogs(ctx context.Context) string {
|
||||
var status, ip, method, path string
|
||||
status = strconv.Itoa(ctx.GetStatusCode())
|
||||
|
||||
Reference in New Issue
Block a user