feat(utils): add GetInternalRedirectPath function

This commit is contained in:
xfy 2026-06-03 16:39:36 +08:00
parent 1a6b5f9166
commit 5066a1a64c

View File

@ -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 ""
}