Repository navigation
fix: enforce append size validation across storage backends and support chunked creation - #150
Merged
Merged
Conversation
…rt chunked creation - Validate maxAppendSize and minAppendSize in DiskStorageService and AzureBlobStorageService during stream append - Introduce TusServletRequest.hasContent() with PushbackInputStream peeking to accurately detect content when Content-Length is omitted or negative - Update CreationWithUploadPostRequestHandler and RufhCreationPostRequestHandler to use TusServletRequest.hasContent() - Add chunked append and creation validation tests to python conformity test suite (rufh_conformity_test.py) - Add comprehensive unit and multi-backend integration tests for append size enforcement and chunked creation
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
Enforces append size validation (
maxAppendSizeandminAppendSize) across all storage backends (Disk, S3, Azure Blob) during stream append operations, and introduces robust detection for chunked and streaming creation requests withoutContent-Length.Details
validateMaxAppendSizeandvalidateMinAppendSizechecks inDiskStorageServiceandAzureBlobStorageServiceensuring transfers exceedingmaxAppendSizeor falling belowminAppendSize(when not completing) truncate and throw typed exceptions (MaxAppendSizeExceededException,MinAppendSizeNotMetException).TusServletRequest.hasContent()which conforms to RFC 9112 §6.3 (Transfer-EncodingoverridesContent-Length).Content-Lengthis omitted or negative, peeks 1 byte viaPushbackInputStreamand unreads it to detect whether content exists without consuming bytes from the stream.CreationWithUploadPostRequestHandler(Tus v1.0.0) andRufhCreationPostRequestHandler(RUFH Draft-12) to useservletRequest.hasContent().0\r\n\r\nor empty bodies without Content-Length) now cleanly succeed without erroneously triggeringMinAppendSizeNotMetException.test_chunked_append_and_creation_enforce_max_append_sizeandtest_chunked_append_and_creation_enforce_min_append_sizetoscripts/rufh_conformity_test.py.TusServletRequestTest,CreationWithUploadPostRequestHandlerTest,RufhCreationPostRequestHandlerTest, andDiskStorageServiceTest.testCreationWithUploadChunkedTransferEncodingandtestCreationWithUploadChunkedEmptyBodytoAbstractITTusFileUploadService.