Spaces:
Sleeping
Sleeping
coyotte508
commited on
Commit
·
a73f02a
1
Parent(s):
eed224b
🩹 Fix cookie
Browse files
server.ts
CHANGED
@@ -14,9 +14,10 @@ app.use(async (ctx) => {
|
|
14 |
ctx.body = `<html>
|
15 |
<body>
|
16 |
<pre>${JSON.stringify(Object.fromEntries(Object.entries(ctx.request.headers)), null, 2)}</pre>
|
|
|
17 |
<form method="POST">
|
18 |
<label>Cookie value<br>
|
19 |
-
<input type="text" name="cookie />
|
20 |
</label>
|
21 |
<button>Send</button>
|
22 |
</form>
|
|
|
14 |
ctx.body = `<html>
|
15 |
<body>
|
16 |
<pre>${JSON.stringify(Object.fromEntries(Object.entries(ctx.request.headers)), null, 2)}</pre>
|
17 |
+
<p>Cookie: ${ctx.cookies.get("cookie")?.replace(/</g, '$lt;')}</p>
|
18 |
<form method="POST">
|
19 |
<label>Cookie value<br>
|
20 |
+
<input type="text" name="cookie" />
|
21 |
</label>
|
22 |
<button>Send</button>
|
23 |
</form>
|