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
- b241d9c8Records: Anton tryParse noteKunibert
- 42cc1bc0Records: K12 doneKunibert
- 9e6039eeRecords: gates K11, K12Kunibert
- 59b8fe83Use Hybriel day39 helpersKunibert
- c2e393a2Records: K12 startedKunibert
- 00696678Records: Anton day39 notemre
- 070e01a4Records: parkmre
- bf8af0dcRecords: v1.4 checkedmre
- 44af321bRecords: contract v1.4mre
- 310f3fd0Records: outdated semanticsmre
- 268ebfe6Records: #11 proven live and closedmre
- 88e8aad3Records: K11 verified and deployedmre
- cd4cb09cNo review and status error when the model's tools did not run (kunibert#11)Kunibert
- a6b54efaStatus updatemre
- 5a72268eRecords: #4-#10 done, #11 started, review package on #1mre
- 194c7da6Records: real proof greenmre
- cdfa94a9Records: AppArmor profile for the review sandboxmre
- c1bf02d8Status: sandbox blockermre
- 88aaacc5Records: real proof part 2 (posting works, sandbox blocked by AppArmor userns)mre
- 401df4e8Records: review user logged inmre