From 5066a1a64cbb02be5516f21a79313223b4a87514 Mon Sep 17 00:00:00 2001 From: xfy Date: Wed, 3 Jun 2026 16:39:36 +0800 Subject: [PATCH] feat(utils): add GetInternalRedirectPath function --- internal/utils/internal.go | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/internal/utils/internal.go b/internal/utils/internal.go index ec4c0bb..4b79c1e 100644 --- a/internal/utils/internal.go +++ b/internal/utils/internal.go @@ -22,4 +22,14 @@ func IsInternalRedirect(ctx *fasthttp.RequestCtx) bool { return ctx.UserValue(InternalRedirectKey) != nil } +// GetInternalRedirectPath 获取内部重定向目标路径 +func GetInternalRedirectPath(ctx *fasthttp.RequestCtx) string { + if v := ctx.UserValue(InternalRedirectKey); v != nil { + if s, ok := v.(string); ok { + return s + } + } + return "" +} +