Conversation
There was a problem hiding this comment.
Pull Request Overview
This is a version bump release from v0.11.8 to v0.11.9 that introduces a direct backend strategy option for the FastEdge CLI to fix backend request handling.
- Updated the BackendRequest trait to return only Parts instead of a tuple with String and Parts
- Added a new BackendStrategy enum with Direct and FastEdge options to control backend behavior
- Modified the backend_request implementation to handle both strategies with appropriate logging
Reviewed Changes
Copilot reviewed 5 out of 6 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| Cargo.toml | Version bump from 0.11.8 to 0.11.9 |
| CHANGELOG.md | Added release notes for v0.11.9 with bug fix entry |
| crates/runtime/src/lib.rs | Updated BackendRequest trait signature and componentize_if_necessary function lifetime parameters |
| crates/http-service/src/state.rs | Implemented strategy-based backend request handling with Direct and FastEdge modes |
| crates/http-backend/src/lib.rs | Made strategy field public to enable external access |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
| pub trait BackendRequest { | ||
| fn backend_request(&mut self, head: Parts) -> anyhow::Result<(String, Parts)>; | ||
| fn backend_request(&mut self, head: Parts) -> anyhow::Result<Parts>; |
There was a problem hiding this comment.
This is a breaking API change that removes the String return value from the backend_request method. Consider deprecating the old method first or providing a migration guide to help consumers adapt to this change.
| match self.http_backend.strategy { | ||
| http_backend::BackendStrategy::Direct => { |
There was a problem hiding this comment.
[nitpick] The Direct strategy implementation is very minimal and doesn't perform the same URI validation or processing as the FastEdge strategy. Consider documenting the behavior differences or adding basic validation to ensure the Direct strategy handles edge cases appropriately.
| match self.http_backend.strategy { | |
| http_backend::BackendStrategy::Direct => { | |
| http_backend::BackendStrategy::Direct => { | |
| // Direct strategy: minimal processing, does not filter or augment headers. | |
| // Unlike FastEdge, this does not perform header filtering or URI rewriting. | |
| // Basic validation: ensure the URI has a scheme and authority. | |
| let uri = &head.uri; | |
| if uri.scheme_str().is_none() || uri.authority().is_none() { | |
| return Err(anyhow::anyhow!( | |
| "Direct strategy: request URI missing scheme or authority: {:?}", | |
| uri | |
| )); | |
| } |
releases/v0.11.9