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