Spaces:
Sleeping
Sleeping
coyotte508
commited on
Commit
·
0a48e3f
1
Parent(s):
041c812
stupid koa!!!
Browse files
server.ts
CHANGED
|
@@ -8,8 +8,10 @@ app.use(bodyParser());
|
|
| 8 |
app.use(async (ctx) => {
|
| 9 |
if (ctx.request.method === "POST") {
|
| 10 |
const { cookie } = ctx.request.body as { cookie: string };
|
| 11 |
-
ctx.set("Set-Cookie",
|
| 12 |
-
|
|
|
|
|
|
|
| 13 |
ctx.redirect( "/");
|
| 14 |
} else {
|
| 15 |
ctx.body = `<html>
|
|
|
|
| 8 |
app.use(async (ctx) => {
|
| 9 |
if (ctx.request.method === "POST") {
|
| 10 |
const { cookie } = ctx.request.body as { cookie: string };
|
| 11 |
+
ctx.set("Set-Cookie", [
|
| 12 |
+
`cookie-none=${cookie.replace(/[^A-Za-z0-9]+/g, '-')}; SameSite=None; Secure`,
|
| 13 |
+
`cookie-lax=${cookie.replace(/[^A-Za-z0-9]+/g, '-')}; SameSite=Lax; Secure`
|
| 14 |
+
]);
|
| 15 |
ctx.redirect( "/");
|
| 16 |
} else {
|
| 17 |
ctx.body = `<html>
|