mirror of
https://github.com/fosrl/pangolin.git
synced 2026-03-03 17:26:38 +00:00
Compare commits
1 Commits
1.15.4-s.9
...
1.15.4-s.1
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
978ac8f53c |
@@ -2,31 +2,22 @@ import { headers } from "next/headers";
|
|||||||
|
|
||||||
export async function authCookieHeader() {
|
export async function authCookieHeader() {
|
||||||
const otherHeaders = await headers();
|
const otherHeaders = await headers();
|
||||||
const otherHeadersObject = Object.fromEntries(otherHeaders.entries());
|
const otherHeadersObject = Object.fromEntries(
|
||||||
|
Array.from(otherHeaders.entries()).map(([k, v]) => [k.toLowerCase(), v])
|
||||||
|
);
|
||||||
|
|
||||||
|
console.info(`Setting cookie... x-forwarded-for: ${otherHeadersObject["x-forwarded-for"]}`)
|
||||||
|
|
||||||
return {
|
return {
|
||||||
headers: {
|
headers: {
|
||||||
cookie:
|
cookie: otherHeadersObject["cookie"],
|
||||||
otherHeadersObject["cookie"] || otherHeadersObject["Cookie"],
|
host: otherHeadersObject["host"],
|
||||||
host: otherHeadersObject["host"] || otherHeadersObject["Host"],
|
"user-agent": otherHeadersObject["user-agent"],
|
||||||
"user-agent":
|
"x-forwarded-for": otherHeadersObject["x-forwarded-for"],
|
||||||
otherHeadersObject["user-agent"] ||
|
"x-forwarded-host": otherHeadersObject["x-forwarded-host"],
|
||||||
otherHeadersObject["User-Agent"],
|
"x-forwarded-port": otherHeadersObject["x-forwarded-port"],
|
||||||
"x-forwarded-for":
|
"x-forwarded-proto": otherHeadersObject["x-forwarded-proto"],
|
||||||
otherHeadersObject["x-forwarded-for"] ||
|
"x-real-ip": otherHeadersObject["x-real-ip"]
|
||||||
otherHeadersObject["X-Forwarded-For"],
|
|
||||||
"x-forwarded-host":
|
|
||||||
otherHeadersObject["fx-forwarded-host"] ||
|
|
||||||
otherHeadersObject["Fx-Forwarded-Host"],
|
|
||||||
"x-forwarded-port":
|
|
||||||
otherHeadersObject["x-forwarded-port"] ||
|
|
||||||
otherHeadersObject["X-Forwarded-Port"],
|
|
||||||
"x-forwarded-proto":
|
|
||||||
otherHeadersObject["x-forwarded-proto"] ||
|
|
||||||
otherHeadersObject["X-Forwarded-Proto"],
|
|
||||||
"x-real-ip":
|
|
||||||
otherHeadersObject["x-real-ip"] ||
|
|
||||||
otherHeadersObject["X-Real-IP"]
|
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user