Fix critical bugs in hook dispatch, response status, resource cleanup, and instance isolation#16
Draft
Fix critical bugs in hook dispatch, response status, resource cleanup, and instance isolation#16
Conversation
…, 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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Seven bugs fixed across the core request/response lifecycle that affected correctness and robustness of the HTTP server.
Bug fixes
_executeHookshardcoded to_init—executeGroupHooks()iterated_initinstead of thehooksparameter, so shutdown and error hooks never fired for group-scoped routesResponse.json()ignoredstatusparam — acceptedstatusbut never assigned it tothis.statusawaiton OPTIONS hook execution — async_executeHookscall was fire-and-forget_extractBoundarycase-sensitive header lookup — checked'Content-Type'but Shelf normalizes to'content-type', breaking multipart parsingresetResourcesonly called on 404 path — per-context resources leaked on successful and OPTIONS requests; restructuredrun()to always clean up_supervisorswas a module-level global — allHttpinstances shared one list; moved to instance fieldHEADin_routesmap — inconsistent withHttp._routeswhich includes itTests
10 new unit tests covering
Responsemethods (status propagation, headers, cookies) andHttpbehavior (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/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
💬 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.