feat(utils): add GetInternalRedirectPath function
This commit is contained in:
parent
1a6b5f9166
commit
5066a1a64c
@ -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 ""
|
||||
}
|
||||
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user