tracker
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
- 9652782dlog: HM59 merged, DP68 startedmre
- 29867a75Merge hm59-logic: tracker#59 page logic moved to libmre
- f7bfe90bMove remaining page builders into their topicsmre
- 7c3991f9log: day46 from Antonmre
- ec54fc35Move show page logic into the shows topicmre
- c1a8d074log: correct timesmre
- 5827eba9log: HM57 merged, HM59 startedmre
- d1a91be9Merge hm57-let: tracker#57 let only for reassigned namesmre
- a404ed75Report HM57 audit, gates and integration notesmre
- 1dcb87a7Use plain declarations for unchanged bindingsmre
- b90395e3log: HM51 mergedmre
- 9888d076Merge hm51-classes: tracker#51 views use Style referencesmre
- 4399bc2fReference remaining component-owned root Style rulesmre
- 9edcc2dflog: #58 live, HM57 startedmre
- 73fa20ddMerge hm49b-styles: tracker#49 rest of the component stylesmre
- aed12917Reference owned Style rules in genres and searchmre
- 14195720log: HM49B done, HM51 startedmre
- 78ee6b56Move remaining component styles into Style blocksmre
- 7f04de33log: HM49Bmre
- 00616cf3log: #49 batch merged, DP67 startedmre