Extend network stack: session/auth, WebSocket, cookie/multipart primitives
Add the network-extension wave to lib/net and the web ABI plugin:
- lib/net cookie_parse / multipart_parse host primitives (EN/ZH)
- plugins/web session store + /admin login gate + WebSocket client/server
- ext/web author surface (EN/ZH) for session, auth, ws
- form update flow and page-level validation echo tests
- fix string escapes: \xHH, \u{...}, unknown escapes kept verbatim
- map Chinese component slots (导航/侧栏/页脚) so sidebar renders
- resolve relative static/db paths against the entry script dir (entry_dir)
- new tutorial chapter 14, EN/ZH example sites, and gold tests
Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
1 parent
7dfa161422
commit
7645dd4c1f
47 files changed
+3380
-75
No files matched your search
@@ -0,0 +1,17 @@
|
||||
---
|
||||
title: net cookie_parse
|
||||
import net:lib/net.mq.md
|
||||
---
|
||||
|
||||
# main
|
||||
|
||||
*req = > net.cookie_parse text="session=abc123; theme=dark"*
|
||||
|
||||
*resp = > net.cookie_parse text="id=42; Path=/; HttpOnly; Secure; SameSite=Lax, theme=light; Max-Age=3600" is_response=True*
|
||||
|
||||
> print text=`req`[^1][^name]
|
||||
> print text=`req`[^1][^value]
|
||||
> print text=`resp`[^1][^http_only]
|
||||
> print text=`resp`[^1][^secure]
|
||||
> print text=`resp`[^1][^same_site]
|
||||
> print text=`resp`[^2][^max_age]
|
||||
@@ -0,0 +1,19 @@
|
||||
---
|
||||
title: net multipart_parse
|
||||
import net:lib/net.mq.md
|
||||
---
|
||||
|
||||
# main
|
||||
|
||||
`boundary` = ----WebKitFormBoundary7MA4YWxkTrZu0gW
|
||||
|
||||
`body` = "--`boundary`\nContent-Disposition: form-data; name=\"title\"\n\nHello\n--`boundary`\nContent-Disposition: form-data; name=\"file\"; filename=\"a.txt\"\nContent-Type: text/plain\n\nfile body\n--`boundary`--\n"
|
||||
|
||||
*parts = > net.multipart_parse body=`body` boundary=`boundary`*
|
||||
|
||||
> print text=`parts`[^1][^name]
|
||||
> print text=`parts`[^1][^value]
|
||||
> print text=`parts`[^2][^name]
|
||||
> print text=`parts`[^2][^filename]
|
||||
> print text=`parts`[^2][^content_type]
|
||||
> print text=`parts`[^2][^value]
|
||||
Reference in new issue
Block a user