kunibert
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
Latest commits
- 2b04c240Merge branch 'hl-standard-l10' into mainKunibert
- 88c7b09d|||PR HL-STANDARD L10 update (hybriel 5885d688), rules version 3mre
- 00869ecbrecords: gitoria#50 step 3 livemre
- f97a0e5fMerge branch 'hl-standard' into mainKunibert
- 9710e39fType STANDARD as String (L10, Kunibert review)mre
- 4140b664|||PR Review against HL-STANDARD and cite rule ids (gitoria#50 step 3)mre
- 75c6888drecords: gitoria#50 step 1 connected and provenmre
- aa6d997frecords: gitoria#50 connect plan, Anton reportmre
- 8a190ba7Records: kunibert#18 and #15 donemre
- 2eee9dbbMerge branch 'revendor-day44' into mainKunibert
- e96721cb|||PR Re-vendor plugins from Hybriel day44 (hl:fetch redirect fix)mre
- 0c67ab8cLog: kunibert repo ping provenmre
- b6f3039cLog: kunibert repo connectedmre
- b143c3c7CONDUCTOR: push recipemre
- 7a1279eeRule: conductor merges own utility PRs after green reviewmre
- 4038b3e0Log: kunibert#18 openedmre
- 18543db1Log: day42 fetch fix, re-vendor pendingmre
- 81a12f96Statusmre
- 6ce706abRecords: neutral wording, split cleanupmre
- 81a4d31bDocs: neutral wordingKunibert