test
All checks were successful
/ build (push) Successful in 14s

This commit is contained in:
Soph :3 2024-05-23 17:50:56 +03:00
parent c461ec3078
commit 8158f9b68b
Signed by: sophie
GPG key ID: EDA5D222A0C270F2

View file

@ -40,13 +40,13 @@ 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"); 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 || !hostHeader ||
!verifyRequestOrigin(originHeader, [hostHeader, "localhost:5173"]) !verifyRequestOrigin(originHeader, [hostHeader])
) { ) {
return { return {
user: null, user: null,