gitoria

tickets

All repositories: gitoria

ReadmeCodePull requestsReleasesTicketsSettings
Commit78c7f48e78c7f48eRefine mpackdb holdmre78c7f48e/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

  • 78c7f48eRefine mpackdb holdmre
  • 3d7d89c8Record mpackdb hold until day38mre
  • f1bf7195#51 done; my subscription idmre
  • 9870b945status: #51 proof greenmre
  • e92173c6log: #51 live push proofmre
  • 72d87041log: Hermes push livemre
  • 1d69bf7dTickets conductor: park until Hermes pushmre
  • 80d8cfd1Tickets conductor: #51 livemre
  • 61641dd9Complete subscriptions deployment evidencemre
  • c980856cRecord successful subscriptions deployment and live checksmre
  • 4b4710adMerge branch 's51-subscriptions'mre
  • a731ef7eTickets conductor: S51 reviewed, deploy stepmre
  • b487b05aRecord verified direct push protocol handoffmre
  • 74e34cc3Verify encrypted push secrets and direct push retry semanticsmre
  • a1ac5cd0Push subscription notices directly to signed HyperConductor chat endpointsmre
  • d662ad27Remove superseded waker service for direct chat push protocolmre
  • c0ac927aTickets conductor: S51 redo for push protocolmre
  • ff2e8701Finalize subscription build verification and handoff reportmre
  • 07c6daeeTickets conductor: push allowlist URLsmre
  • 8517d14cTickets conductor: Hermes push endpointmre