parent
c461ec3078
commit
8158f9b68b
|
@ -40,13 +40,13 @@ export default new Elysia({
|
|||
if (context.request.method !== "GET") {
|
||||
const originHeader = context.request.headers.get("Origin");
|
||||
// NOTE: You may need to use `X-Forwarded-Host` instead
|
||||
const hostHeader = context.request.headers.get(process.env.ENV == "production" ? "X-Forwarded-Host" : "Host");
|
||||
const hostHeader = context.request.headers.get(process.env.ENV == "production" ? "x-forwarded-host" : "host");
|
||||
console.log(context.request.headers)
|
||||
console.log(originHeader);
|
||||
if (
|
||||
!originHeader ||
|
||||
!hostHeader ||
|
||||
!verifyRequestOrigin(originHeader, [hostHeader, "localhost:5173"])
|
||||
!verifyRequestOrigin(originHeader, [hostHeader])
|
||||
) {
|
||||
return {
|
||||
user: null,
|
||||
|
|
Loading…
Reference in a new issue