- Delete unused files: tempfile subsystem, matcher variants, server/internal - Remove 200+ unused functions across proxy, ssl, lua, http2/3, stream, variable - Fix proxy test type errors (backgroundRefresh ctx→Request) - Move bench/tools mock backend into internal/testutil - Remove corresponding test functions for all deleted code
21 lines
501 B
Go
21 lines
501 B
Go
package utils
|
|
|
|
import "github.com/valyala/fasthttp"
|
|
|
|
const (
|
|
// InternalRedirectKey 内部重定向标记
|
|
InternalRedirectKey = "__internal_redirect__"
|
|
)
|
|
|
|
// SetInternalRedirect 标记请求为内部重定向
|
|
func SetInternalRedirect(ctx *fasthttp.RequestCtx, targetPath string) {
|
|
ctx.SetUserValue(InternalRedirectKey, targetPath)
|
|
}
|
|
|
|
// IsInternalRedirect 检查是否为内部重定向
|
|
func IsInternalRedirect(ctx *fasthttp.RequestCtx) bool {
|
|
return ctx.UserValue(InternalRedirectKey) != nil
|
|
}
|
|
|
|
|