mirror of
https://github.com/sr229/kuru-kuru.git
synced 2024-09-20 04:10:33 +00:00
Use Sec-Fetch-Mode to check instead
This commit is contained in:
parent
69e462f758
commit
438712c05b
1 changed files with 4 additions and 4 deletions
|
@ -22,8 +22,8 @@ export const handler: Handlers = {
|
|||
const headers = req.headers;
|
||||
|
||||
// check if useragent is a browser
|
||||
// we can use the Sec-Ch-Ua header but it's not supported by all browsers
|
||||
if (!headers.get("sec-ch-ua")) {
|
||||
// we can use the Sec-Fetch-Mode header but it's not supported by all browsers
|
||||
if (!headers.get("sec-fetch-mode")) {
|
||||
return new Response("", {
|
||||
status: 403,
|
||||
statusText: "Forbidden",
|
||||
|
@ -89,8 +89,8 @@ export const handler: Handlers = {
|
|||
const headers = req.headers;
|
||||
|
||||
// check if useragent is a browser
|
||||
// we can use the Sec-Ch-Ua header but it's not supported by all browsers
|
||||
if (!headers.get("sec-ch-ua")) {
|
||||
// we can use the Sec-Fetch-Mode header but it's not supported by all browsers
|
||||
if (!headers.get("sec-fetch-mode")) {
|
||||
return new Response("", {
|
||||
status: 403,
|
||||
statusText: "Forbidden",
|
||||
|
|
Loading…
Reference in a new issue