feat: enterprise hardening - request bodies, radix router, and error …#1
Conversation
|
Caution Review failedPull request was closed or merged during review 📝 WalkthroughWalkthroughThis PR introduces a comprehensive framework enhancement with new middleware support (CORS, validation), security hardening (prototype pollution prevention, CRLF injection mitigation), object pooling for performance, error handler registration, radix-tree-based dynamic routing, and refactored HTTP parsing. It removes legacy "old" engine benchmarks and adds six example applications demonstrating core features. Changes
Sequence Diagram(s)sequenceDiagram
participant Client
participant Parser as HTTP Parser<br/>(httparse)
participant Router as Radix Tree<br/>Router
participant MiddleWare as Middleware<br/>Chain
participant Handler as Route<br/>Handler
participant ErrHandler as Error<br/>Handler
participant ResponseWriter as Response<br/>Writer
Client->>Parser: TCP Stream Buffer
Parser->>Parser: Parse headers/body<br/>→ ParsedRequest
Parser->>Router: Match parsed route
Router->>Router: Traverse radix tree<br/>→ Matched route + params
Router->>MiddleWare: Execute middleware stack
alt Middleware Success
MiddleWare->>Handler: Call route handler
alt Handler Success
Handler->>ResponseWriter: Serialize response
ResponseWriter->>Client: Write Buffer to TCP
else Handler Throws
Handler->>ErrHandler: Dispatch error
ErrHandler->>ResponseWriter: Serialize error response
ResponseWriter->>Client: Write error Buffer to TCP
end
else Middleware Throws
MiddleWare->>ErrHandler: Dispatch error
ErrHandler->>ResponseWriter: Serialize error response
ResponseWriter->>Client: Write error Buffer to TCP
end
Estimated code review effort🎯 4 (Complex) | ⏱️ ~75 minutes Poem
🚥 Pre-merge checks | ✅ 2 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
We will push this to the uno branch to check benchmarks |
feat!: architecture hardening and enterprise feature suite
CORE & PERFORMANCE:
FEATURES & MIDDLEWARE:
DEVELOPER EXPERIENCE:
SECURITY:
Summary by CodeRabbit
Release Notes
New Features
app.onError()Documentation
Security
Chores