Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(middleware): add light mode #9

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

baptadn
Copy link
Contributor

@baptadn baptadn commented Nov 6, 2024

Light mode

The response rewriting features (e.g., SEO overrides, custom body, etc.) of redirection.io are currently not compatible with React Server Components (RSC). This is due to the fact that Vercel’s middleware implementation does not follow standard middleware protocols, requiring us to fetch requests, which is incompatible with both RSC and Vercel’s implementation.

However, we provide a light mode that supports RSC by offering only the redirection functionality. To enable this mode, simply set the mode option to light.

This allows you to implement redirection behavior without modifying response content, ensuring smooth operation with RSC.

const middleware = createRedirectionIoMiddleware({
    // …
    mode: "light",
});

@baptadn baptadn force-pushed the feature/restricted branch 7 times, most recently from 17c58bd to 8f3c9f7 Compare November 6, 2024 16:33
@baptadn baptadn changed the title feat(middleware): add restricted option feat(middleware): add light mode Nov 6, 2024
@baptadn baptadn force-pushed the feature/restricted branch 2 times, most recently from cb112df to e768195 Compare November 6, 2024 16: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.

1 participant