some origin header
This commit is contained in:
parent
cc27012ded
commit
4650c32fd1
2
.gitignore
vendored
2
.gitignore
vendored
@ -34,3 +34,5 @@ yarn-error.log*
|
|||||||
# typescript
|
# typescript
|
||||||
*.tsbuildinfo
|
*.tsbuildinfo
|
||||||
next-env.d.ts
|
next-env.d.ts
|
||||||
|
|
||||||
|
.env
|
12
src/middleware.ts
Normal file
12
src/middleware.ts
Normal 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*',
|
||||||
|
};
|
Loading…
x
Reference in New Issue
Block a user