Enhance DCA processing for REQUEST_PATH in nested fragments - #61
Conversation
…_STRING` in nested fragments Fixes #49
There was a problem hiding this comment.
Warning
Copilot couldn't run its full agentic review because it didn't start before the timeout. Make sure your repository has a runner available, or add a copilot-code-review.yml file specifying one with the runs-on attribute. See the docs for more details.
Pull request overview
Aligns nested dca=esi fragment processing with Akamai behavior by ensuring request-scoped variables reflect the fragment URL instead of the top-level client request.
Changes:
- Pass the fragment request into isolated processors so
REQUEST_PATH/QUERY_STRINGare derived from the fragment context in nested DCA scenarios. - Add regression tests covering nested
dca=esibehavior forREQUEST_PATHandQUERY_STRING, plus a top-level guard test.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| esi/src/lib.rs | Uses the fragment request (instead of the parent request) when spawning isolated processors for nested DCA/ESI evaluation. |
| esi/tests/dca_tests.rs | Adds run_with_request helper and new tests validating REQUEST_PATH/QUERY_STRING semantics in nested fragments. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
| let resp_handler = self.fragment_response_handler; | ||
| let mut isolated_processor = Processor::new( | ||
| Some(self.processor.ctx.get_request().clone_without_body()), | ||
| Some(fragment.req.clone_without_body()), |
There was a problem hiding this comment.
Worth checking that it's intentional to also match the method, headers, host, etc.
Adjustments ensure that
REQUEST_PATHreflects the fragment's URL in nested ESI scenarios, aligning with Akamai's behavior. Additionally,QUERY_STRINGnow accurately represents the fragment's query string.Fixes #49