Repository navigation
Fix file upload FormatException for parameterized Content-Type - #9969
Merged
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR aims to prevent a FormatException during multipart file uploads when the provided file Content-Type includes parameters (for example text/plain; charset=utf-8), and adds regression coverage in both Fusion and Transport HTTP client tests.
Changes:
- Adds a Fusion snapshot test covering forwarding of parameterized file
Content-Typevalues. - Extends
GraphQLHttpClientTeststo include a parameterizedContent-Typecase. - Updates
DefaultGraphQLHttpClientmultipart file part header handling forContent-Type.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/FileUploadTests.cs |
Adds a Fusion regression test for parameterized file Content-Type. |
src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/FileUploadTests.Upload_Single_File_Should_Forward_Parameterized_ContentType.yaml |
Adds snapshot asserting the multipart part includes Content-Type: text/plain; charset=utf-8 and the server sees it. |
src/HotChocolate/AspNetCore/test/Transport.Http.Tests/GraphQLHttpClientTests.cs |
Adds theory input for parameterized Content-Type in file upload test coverage. |
src/HotChocolate/AspNetCore/src/Transport.Http/DefaultGraphQLHttpClient.cs |
Changes how multipart file part Content-Type is set (currently via TryAddWithoutValidation). |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Code Coverage OverviewLanguages: C# C# / code-coverage/dotnetThe overall coverage in the Show a code coverage summary of the most impacted files.
Code Coverage is in Public Preview. Learn more and provide us with your feedback. |
This was referenced Jun 26, 2026
Closed
This was referenced Jul 5, 2026
This was referenced Jul 13, 2026
This was referenced Aug 27, 2026
Closed
This was referenced Sep 7, 2026
This was referenced Sep 17, 2026
This was referenced Sep 28, 2026
This was referenced Oct 5, 2026
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.
Fixes #9922