Skip to content

Fix critical bugs in hook dispatch, response status, resource cleanup, and instance isolation#16

Draft
Copilot wants to merge 3 commits intomainfrom
copilot/fix-corner-code-issues
Draft

Fix critical bugs in hook dispatch, response status, resource cleanup, and instance isolation#16
Copilot wants to merge 3 commits intomainfrom
copilot/fix-corner-code-issues

Conversation

Copy link
Copy Markdown

Copilot AI commented Mar 12, 2026

Seven bugs fixed across the core request/response lifecycle that affected correctness and robustness of the HTTP server.

Bug fixes

  • _executeHooks hardcoded to _initexecuteGroupHooks() iterated _init instead of the hooks parameter, so shutdown and error hooks never fired for group-scoped routes
  • Response.json() ignored status param — accepted status but never assigned it to this.status
  • Missing await on OPTIONS hook execution — async _executeHooks call was fire-and-forget
  • _extractBoundary case-sensitive header lookup — checked 'Content-Type' but Shelf normalizes to 'content-type', breaking multipart parsing
  • resetResources only called on 404 path — per-context resources leaked on successful and OPTIONS requests; restructured run() to always clean up
  • _supervisors was a module-level global — all Http instances shared one list; moved to instance field
  • Router missing HEAD in _routes map — inconsistent with Http._routes which includes it

Tests

10 new unit tests covering Response methods (status propagation, headers, cookies) and Http behavior (group hook dispatch, 404 handling, supervisor isolation).

Warning

Firewall rules blocked me from connecting to one or more addresses (expand for details)

I tried to connect to the following addresses, but was blocked by firewall rules:

  • dl-ssl.google.com
    • Triggering command: /usr/bin/wget wget -qO- REDACTED (dns block)

If you need me to access, download, or install something from one of these locations, you can either:

Original prompt

corner code fix any issues and make it complete and robust library to build http servers


💬 Send tasks to Copilot coding agent from Slack and Teams to turn conversations into code. Copilot posts an update in your thread when it's finished.

Copilot AI and others added 2 commits March 12, 2026 16:14
…, resource cleanup, global state, HEAD routing

Co-authored-by: lohanidamodar <6360216+lohanidamodar@users.noreply.github.com>
Co-authored-by: lohanidamodar <6360216+lohanidamodar@users.noreply.github.com>
Copilot AI changed the title [WIP] Fix issues and improve robustness of HTTP server library Fix critical bugs in hook dispatch, response status, resource cleanup, and instance isolation Mar 12, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants