notes
All repositories: gitoria
1.0 KB
// hl:http1 — HTTP response wrapper (file-as-class: Response)// Split from the former multi-class server.hl (mission 027).// The file root IS the constructor (mission 052 — `__construct` is gone).// Construction is positional: `new Response(body)` or// `new Response(body, { status = 404 })`. Positional args bind to properties in// DECLARATION order, so `body` and `options` must stay the first two// declarations; the run body below folds `options` into status/headers.// A Bytes body is sent raw, byte for byte (ticket #88) — what an app stored from// `req.bytes` can be served back — and says application/octet-stream unless the// headers name a type.String | Bytes body = ''Hybrid options = nullNumber status = 200Hybrid headers = {}if (options != null) {if (options.status != null) {status = options.status}if (options.headers != null) {headers = options.headers}}if (hlTypeName(body) == 'Bytes') {let typed = falsefor (k of headers.keys()) {if (k.toLowerCase() == 'content-type') { typed = true }}if (!typed) { headers['Content-Type'] = 'application/octet-stream' }}
Branches
- mainmain branch
Latest commits
- 2bebebdanotes: Hybriel master ff51cf46 (re-vendor round)mre
- 3eff126dnotes#3: installable app (manifest + own icon/favicon; notes' own sw.js kept)mre
- 9883c540deploy.sh: back up live storage/.sessions/.env before every deploy (newest 5 kept)mre
- eee693b8deploy.sh: never send .git or .gitignore to Byrodinmre
- c8904061State of 2026-09-27, before the move to gitoriamre