gitoriaLog in with ident

gitoria

All repositories: gitoria

ReadmeCodePull requestsReleasesTicketsSettings
Commit4a2d71254a2d7125initial commitmre4a2d7125/plugins/http1/response.hl

710 B

  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. String body = ''
  9. Hybrid options = null
  10. Number status = 200
  11. Hybrid headers = {}
  12. if (options != null) {
  13. if (options.status != null) {
  14. status = options.status
  15. }
  16. if (options.headers != null) {
  17. headers = options.headers
  18. }
  19. }

Branches

Latest commits

  • 4a2d7125initial commitmre