Spaces:
Runtime error
Runtime error
Update proxy.js
Browse files
proxy.js
CHANGED
|
@@ -94,11 +94,6 @@ const server = http.createServer((req, res) => {
|
|
| 94 |
const isUiPage =
|
| 95 |
url.pathname === "/" || url.pathname === "/chat";
|
| 96 |
|
| 97 |
-
const cookiePresent =
|
| 98 |
-
/(?:^|;\s*)oc_token_bootstrap=1(?:;|$)/.test(
|
| 99 |
-
req.headers.cookie || ""
|
| 100 |
-
);
|
| 101 |
-
|
| 102 |
if (isUiPage && !cookiePresent) {
|
| 103 |
res.writeHead(302, {
|
| 104 |
location:
|
|
@@ -107,7 +102,7 @@ const server = http.createServer((req, res) => {
|
|
| 107 |
"#token=" +
|
| 108 |
encodeURIComponent(TOKEN),
|
| 109 |
"set-cookie":
|
| 110 |
-
"oc_token_bootstrap=1; Path=/; Max-Age=
|
| 111 |
"cache-control": "no-store",
|
| 112 |
"referrer-policy": "no-referrer"
|
| 113 |
});
|
|
|
|
| 94 |
const isUiPage =
|
| 95 |
url.pathname === "/" || url.pathname === "/chat";
|
| 96 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 97 |
if (isUiPage && !cookiePresent) {
|
| 98 |
res.writeHead(302, {
|
| 99 |
location:
|
|
|
|
| 102 |
"#token=" +
|
| 103 |
encodeURIComponent(TOKEN),
|
| 104 |
"set-cookie":
|
| 105 |
+
"oc_token_bootstrap=1; Path=/; Max-Age=5; Secure; SameSite=None",
|
| 106 |
"cache-control": "no-store",
|
| 107 |
"referrer-policy": "no-referrer"
|
| 108 |
});
|