Spaces:
Sleeping
Sleeping
coyotte508
commited on
Commit
·
041c812
1
Parent(s):
86ae757
stupid koa
Browse files
server.ts
CHANGED
|
@@ -8,8 +8,8 @@ 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.
|
| 12 |
-
ctx.
|
| 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", `cookie-none=${cookie.replace(/[^A-Za-z0-9]+/g, '-')}; SameSite=None; Secure`);
|
| 12 |
+
ctx.set("Set-Cookie", `cookie-lax=${cookie.replace(/[^A-Za-z0-9]+/g, '-')}; SameSite=Lax; Secure`);
|
| 13 |
ctx.redirect( "/");
|
| 14 |
} else {
|
| 15 |
ctx.body = `<html>
|