test: x-forwarded-proto

This commit is contained in:
DIYgod
2023-10-21 16:16:06 +08:00
parent 9a495cdaaf
commit 31d9aa67ae
2 changed files with 7 additions and 6 deletions
+5
View File
@@ -17,6 +17,11 @@ export default async function middleware(req: NextRequest) {
requestHeaders.set("x-xlog-search", req.nextUrl.search)
requestHeaders.set("x-xlog-ip", getClientIp(req) || "")
console.log(
`x-forwarded-proto: ${req.headers.get(
"x-forwarded-proto",
)}, cf-visitor: ${req.headers.get("cf-visitor")}`,
)
if (
IS_PROD &&
req.headers.get("x-forwarded-proto") !== "https" &&