-
-
Notifications
You must be signed in to change notification settings - Fork 10.7k
Fix flows for returning/throwing data() from middleware #14128
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
Conversation
🦋 Changeset detectedLatest commit: 908f6a7 The changes in this PR will be included in the next version bump. This PR includes changesets to release 11 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
5ec2880
to
908f6a7
Compare
🤖 Hello there, We just published version Thanks! |
🤖 Hello there, We just published version Thanks! |
Is throwing a response in middleware supported? export const unstable_middleware = [
({ request, context }) => {
// the browser should show plain text, not html with the page
throw new Response("play text", {
headers: { "content-type": "text/plain" },
});
},
]; Right now I have to implement my own server that wraps react-router for this use case because if you throw a response in a |
yes - but if you just want a raw response from your loader, why not use a resource route instead? |
Awesome! My use case is to return a plain text response when a catchall route ends with .md extension in a docs website. The route is the same as the page so it cannot be a resource route. |
🤖 Hello there, We just published version Thanks! |
🤖 Hello there, We just published version Thanks! |
No description provided.