Skip to content

Commit

Permalink
Security headers and sockopt revised.
Browse files Browse the repository at this point in the history
  • Loading branch information
bia-pain-bache committed Mar 23, 2024
1 parent 9a6518a commit ef52ec3
Showing 1 changed file with 14 additions and 6 deletions.
20 changes: 14 additions & 6 deletions worker.js
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,13 @@ export default {
return new Response(htmlPage, {
status: 200,
headers: {
"Content-Type": "text/html"
"Content-Type": "text/html",
"Access-Control-Allow-Origin": url.origin,
"Access-Control-Allow-Methods": "GET, POST",
"Access-Control-Allow-Headers": "Content-Type, Authorization",
"X-Content-Type-Options": "nosniff",
"X-Frame-Options": "DENY",
"Referrer-Policy": "strict-origin-when-cross-origin"
},
});

Expand Down Expand Up @@ -242,6 +248,12 @@ export default {
status: 200,
headers: {
"Content-Type": "text/html",
"Access-Control-Allow-Origin": url.origin,
"Access-Control-Allow-Methods": "GET, POST",
"Access-Control-Allow-Headers": "Content-Type, Authorization",
"X-Content-Type-Options": "nosniff",
"X-Frame-Options": "DENY",
"Referrer-Policy": "strict-origin-when-cross-origin"
},
});

Expand Down Expand Up @@ -281,7 +293,7 @@ export default {
status: 200,
headers: {
'Set-Cookie': 'jwtToken=; Path=/; Secure; SameSite=None; Expires=Thu, 01 Jan 1970 00:00:00 GMT',
'Content-Type': 'text/plain'
'Content-Type': 'text/plain',
},
});

Expand Down Expand Up @@ -1122,7 +1134,6 @@ const getFragVLESSConfig = async (env, userID) => {
streamSettings: {
sockopt: {
tcpKeepAliveIdle: 100,
TcpNoDelay: true,
},
},
},
Expand Down Expand Up @@ -1265,7 +1276,6 @@ const getFragVLESSConfig = async (env, userID) => {
streamSettings: {
sockopt: {
tcpKeepAliveIdle: 100,
TcpNoDelay: true
},
},
tag: "fragment",
Expand Down Expand Up @@ -1389,8 +1399,6 @@ const getFragVLESSConfig = async (env, userID) => {
},
sockopt: {
dialerProxy: "fragment",
tcpKeepAliveIdle: 100,
tcpNoDelay: true,
},
},
tag: "proxy",
Expand Down

0 comments on commit ef52ec3

Please sign in to comment.