gitoria

kunibert

All repositories: gitoria

ReadmeCodePull requestsReleasesTicketsSettings
Commit56e70dcb56e70dcbrecords: review time limit 1800 s (routger 132)mre56e70dcb/plugins/http1/response.hl

1.0 KB

  1. // hl:http1 — HTTP response wrapper (file-as-class: Response)
  2. // Split from the former multi-class server.hl (mission 027).
  3. // The file root IS the constructor (mission 052 — `__construct` is gone).
  4. // Construction is positional: `new Response(body)` or
  5. // `new Response(body, { status = 404 })`. Positional args bind to properties in
  6. // DECLARATION order, so `body` and `options` must stay the first two
  7. // declarations; the run body below folds `options` into status/headers.
  8. // A Bytes body is sent raw, byte for byte (ticket #88) — what an app stored from
  9. // `req.bytes` can be served back — and says application/octet-stream unless the
  10. // headers name a type.
  11. String | Bytes body = ''
  12. Hybrid options = null
  13. Number status = 200
  14. Hybrid headers = {}
  15. if (options != null) {
  16. if (options.status != null) {
  17. status = options.status
  18. }
  19. if (options.headers != null) {
  20. headers = options.headers
  21. }
  22. }
  23. if (hlTypeName(body) == 'Bytes') {
  24. let typed = false
  25. for (k of headers.keys()) {
  26. if (k.toLowerCase() == 'content-type') { typed = true }
  27. }
  28. if (!typed) { headers['Content-Type'] = 'application/octet-stream' }
  29. }

Branches

Latest commits

  • 56e70dcbrecords: review time limit 1800 s (routger 132)mre
  • c3a304c5Merge branch 'job-timeout' into mainKunibert
  • 402bfeb0|||PR runner: the model run uses the job's time limit (jobTimeoutSeconds), not a fixed 900 smre
  • 8d34ca33records: repo rename (gitoria#53)mre
  • 1e05cb3fMerge branch 'repo-rename' into mainKunibert
  • 6ee0d2e9|||PR intake: match a delivery by repo.id and signature, not URLs (gitoria#53 rename)mre
  • 900ffcd4status: routgermre
  • 59b0b793log: routger merge waitmre
  • e52f094alog: routger intake check (hycon#122)mre
  • f979027frecords: design rule livemre
  • 71efaf84Merge branch 'design-guard' into mainKunibert
  • c0656581|||PR Flag removal of a documented design as major unless his recorded yes is linked; rules version 5mre
  • 901cdd75records: L10 update 2 livemre
  • 4a68016bMerge branch 'hl-standard-l10b' into mainKunibert
  • 246d0f30|||PR HL-STANDARD L10 update (hybriel ab293e5a), rules version 4mre
  • 1aa4d64crecords: HL-STANDARD L10 update livemre
  • 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