Skip to content

Commit 6127306

Browse files
committed
chore: add edge function to handle null user agent
1 parent 0e3f3f2 commit 6127306

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
export default async (request: Request) => {
2+
const userAgent = request.headers.get('user-agent') || ''
3+
4+
if (!userAgent.length) {
5+
return new Response('Access Denied: User-Agent is required', {
6+
status: 403,
7+
headers: {
8+
'Content-Type': 'text/plain',
9+
},
10+
})
11+
}
12+
}
13+
14+
export const config = { path: '/*' }

0 commit comments

Comments
 (0)