docs(server): Add rules file for server middleware#1457
Merged
Conversation
matz3
force-pushed
the
fix/serve-resources-node-api
branch
from
July 17, 2026 14:11
12d02c1 to
4c7555d
Compare
Introduce .claude/rules/server-middleware.md as a home for rules that apply to every middleware in packages/server/lib/middleware/. The first rule requires middlewares to use only the built-in Node.js HTTP API so the underlying HTTP framework (currently Express) can be swapped without rewriting any middleware. Future middleware rules can be added as sections in the same file.
…ources The serveResources middleware relied on Express's res.send, violating the rule that middlewares must use only the built-in Node.js HTTP API so the framework can be swapped. Replace both res.send calls with res.end and set Content-Length explicitly (byte length for the injected HTML string). Also drop the resolved 'Known debt' entry for serveResources from .claude/rules/server-middleware.md.
matz3
force-pushed
the
fix/serve-resources-node-api
branch
from
July 17, 2026 14:18
4c7555d to
206f948
Compare
RandomByte
approved these changes
Jul 17, 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.
No description provided.