Repository navigation
Improve error bodies and move to release-please with NuGet OIDC - #46
Merged
perkops merged 7 commits intoSep 30, 2026
Merged
Conversation
…ypes BuildResponseAsync read bodies with non-JSON, non-text media types as a byte[] and left Content empty, also for error statuses. An error such as a 503 with application/xml or application/octet-stream therefore reached the caller with an empty Content. Error responses are now always read as a string, decoded by the Content-Type charset (UTF-8 when none is given). Success responses keep the existing byte[] behavior for non-text media types.
…binary responses BuildBinaryResponseAsync and BuildStreamBinaryResponseAsync returned only a raw string on errors: no content type, no headers and no way to read a registered error type. FileName also ignored the RFC 5987 filename* parameter, so non-ASCII names arrived mangled. - Add ErrorContentObject, deserialized with the type registered for the status code (AddErrorResponse<T>); null when none is registered or deserialization fails. ErrorContent keeps the raw text. - Fill ContentType and ContentLength on errors, and expose Headers (response and content headers) on success and error. - Prefer ContentDisposition.FileNameStar over FileName. The new members are on the classes only, through a new constructor overload; the existing constructors and the interfaces are unchanged. IsSuccess still follows the HTTP 2xx status.
davidkallesen
approved these changes
Sep 30, 2026
perkops
deleted the
fix/error-body-read-as-string-for-non-text-media-types
branch
September 30, 2026 07:01
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Summary
Changes
✨ Features
🐛 Fixes
👷 CI/CD
🔧 Configuration
📝 Documentation
🔥 Removal