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

Set X-Error for thrown Responses #1531

Merged
merged 3 commits into from
Jun 11, 2024
Merged

Conversation

Brendonovich
Copy link
Contributor

@Brendonovich Brendonovich commented Jun 7, 2024

PR Checklist

Please check if your PR fulfills the following requirements:

  • Tests for the changes have been added (for bug fixes / features)

PR Type

What kind of change does this PR introduce?

  • Bugfix
  • Feature
  • Code style update (formatting, local variables)
  • Refactoring (no functional changes, no api changes)
  • Build related changes
  • CI related changes
  • Documentation content changes
  • infrastructure changes
  • Other... Please describe:

What is the current behavior?

Responses thrown inside server functions don't get re-thrown on the client, as they aren't sent to the client with X-Error set.

What is the new behavior?

X-Error will be set when Responses are thrown inside server functions

Other information

Having read through solidjs/solid-router#387, maybe this header should only be set for thrown redirects? Though personally I'd expect returning/throwing to be isomorphic no matter what is returned/thrown

Closes #1512

Copy link

changeset-bot bot commented Jun 7, 2024

🦋 Changeset detected

Latest commit: a654a66

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@solidjs/start Patch

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

@ryansolid ryansolid merged commit b47ab2c into solidjs:main Jun 11, 2024
1 check passed
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.

[Bug?]: Server functions that throw or return redirects when called in an action do not redirect
2 participants