Skip to content

refactor(redirect): simplify internal abstractions for redirect handling - #1200

Merged
0x676e67 merged 1 commit into
mainfrom
redirect
Jul 26, 2026
Merged

refactor(redirect): simplify internal abstractions for redirect handling#1200
0x676e67 merged 1 commit into
mainfrom
redirect

Conversation

@0x676e67

Copy link
Copy Markdown
Owner

No description provided.

gemini-code-assist[bot]

This comment was marked as spam.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR refactors redirect handling to remove the generic redirect policy trait and instead route redirect decisions through a single internal FollowRedirectPolicy, simplifying the redirect middleware’s type surface.

Changes:

  • Replace the generic redirect Policy trait with concrete FollowRedirectPolicy methods (redirect, for_request, on_request, on_response).
  • Simplify public redirect Action into a tuple wrapper and adjust pending-action wiring to map into internal redirect::Action.
  • Narrow redirect middleware to operate on the crate Body type (instead of generic request bodies).

Reviewed changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
src/redirect.rs Refactors redirect Action wrapper and pending action mapping; moves redirect policy logic into FollowRedirectPolicy methods.
src/client/layer/redirect/policy.rs Removes the generic Policy trait, leaving only redirect attempt/action types for the middleware.
src/client/layer/redirect/future.rs Updates redirect future to use FollowRedirectPolicy directly and simplifies body cloning mechanics.
src/client/layer/redirect.rs Refactors redirect layer/service to use FollowRedirectPolicy directly and only operate on crate Body.
src/client.rs Updates the client service stack type alias to match the new redirect middleware type signature.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread src/client/layer/redirect/policy.rs
Comment thread src/client/layer/redirect/future.rs
Repository owner deleted a comment from gemini-code-assist Bot Jun 26, 2026
@0x676e67
0x676e67 merged commit 8b1b773 into main Jul 26, 2026
63 of 67 checks passed
@0x676e67
0x676e67 deleted the redirect branch July 26, 2026 22:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants