-
-
Notifications
You must be signed in to change notification settings - Fork 814
fix: Set content type header for server function errors #4215
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
Merged
gbj
merged 20 commits into
leptos-rs:main
from
spencewenski:server-fn-err-content-type-fix
Aug 29, 2025
+48
−9
Merged
Changes from all commits
Commits
Show all changes
20 commits
Select commit
Hold shift + click to select a range
9ac211f
fix: Set content type header for server function errors
spencewenski ed942bf
Use CONTENT_TYPE header from `actix` re-export
spencewenski bd317c8
Add `-` in doc comment
spencewenski a507872
Per PR suggestion, fix with an API-breaking change
spencewenski 6b6cafe
Rename `BoxedService#ser` field and use bon-3.0.0
spencewenski 43e76de
[autofix.ci] apply automated fixes
autofix-ci[bot] 9949f79
Fix actix stream/websocket responses
spencewenski fe08880
Fix stream/websocket responses in a couple other places
spencewenski 058a4fe
Replace `todo` doc comment with actual comment
spencewenski dda564b
Update doc comments
spencewenski 198824d
Revert "Update doc comments"
spencewenski 8f3e65b
Revert "Replace `todo` doc comment with actual comment"
spencewenski 427258f
Revert "Fix stream/websocket responses in a couple other places"
spencewenski d446fa2
Revert "Fix actix stream/websocket responses"
spencewenski c2afd96
Revert "[autofix.ci] apply automated fixes"
spencewenski 8a1f474
Revert "Rename `BoxedService#ser` field and use bon-3.0.0"
spencewenski b9c81d1
Revert "Per PR suggestion, fix with an API-breaking change"
spencewenski 3758db9
Merge branch 'main' into server-fn-err-content-type-fix
spencewenski 02a9810
Revert commits to go back to the original semver-compatible approach
spencewenski b03565e
Merge branch 'main' into server-fn-err-content-type-fix
spencewenski File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This formatting is kind of weird, but it's what
cargo fmtwants.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think I'd prefer to modify error_response() to take and set the content type from the codec, then we wouldn't need to define a content_type function on Response
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would also prefer that, but I was trying to avoid introducing a breaking change. Would you prefer to modify
error_responseeven though it would be a breaking change?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, it'll be better to have the better api and do the breaking change.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Alright, sounds good. I’ll update when I get a chance.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Updated the PR, please take a look when you get a chance. I made a few additional breaking changes that I thought made sense and also resolve the middleware issue I originally tried fixing in #4216.