some origin header

This commit is contained in:
Nomi Nonsense (Nonszy) 2025-03-03 14:20:22 +07:00
parent cc27012ded
commit 4650c32fd1
2 changed files with 14 additions and 0 deletions

2
.gitignore vendored
View File

@ -34,3 +34,5 @@ yarn-error.log*
# typescript
*.tsbuildinfo
next-env.d.ts
.env

12
src/middleware.ts Normal file
View File

@ -0,0 +1,12 @@
import { NextResponse } from 'next/server';
import type { NextRequest } from 'next/server';
export function middleware(req: NextRequest) {
const res = NextResponse.next();
res.headers.set('X-Nonszy-Origin', process.env.ORIGIN ?? 'anywhere');
return res;
}
export const config = {
matcher: '/:path*',
};