Repository navigation
Lift the request body limit on the transfer route so large pushes go through [patch] - #101
Merged
Merged
Conversation
…through [patch] Kestrel refuses request bodies over 30,000,000 bytes by default, and nothing lifted that for uploads. Every PUT of an LFS object larger than ~28.6 MB failed part way through the upstream relay and surfaced as a 500. UploadAsync now clears IHttpMaxRequestBodySizeFeature.MaxRequestBodySize once the upload token has been checked, so every host is covered while batch and lock bodies keep the server's bound. Fixes #92 Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01Md2Tr7FWcbqPdwq2BjeG79
|
This was referenced Oct 8, 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 #92
What was wrong
Kestrel refuses request bodies over 30,000,000 bytes by default, and nothing in the library or the tool's host lifted that limit. Every PUT of an LFS object larger than about 28.6 MB failed part way through the upstream relay. Because the refusal happened inside HttpClient's content copy, the client saw a 500 instead of a 413.
Change
ObjectRouteHandler.UploadAsyncsetsIHttpMaxRequestBodySizeFeature.MaxRequestBodySize = nullwhen the feature is present and not read-only. This happens in the library, so every host is covered.locks/batchbodies keep the server's bound.Tests
TestServerdoesn't enforce Kestrel's limit, so the new tests install a stand-inIHttpMaxRequestBodySizeFeatureon the request context, as the issue suggests:Upload_LiftsTheServersRequestBodyLimit: the upload succeeds, is relayed upstream, and leaves the limit atnull. With the fix reverted this test fails withExpected value to be null.Batch_KeepsTheServersRequestBodyLimit: a batch POST leaves the 30,000,000 bound in place.The full suite passes locally: 356 tests, 0 failed.
🤖 Generated with Claude Code
https://claude.ai/code/session_01Md2Tr7FWcbqPdwq2BjeG79
Generated by Claude Code