Repository navigation
fix(files): keep the signed Host header when s3_endpoint_url rewrites the upload URL - #294
Merged
Merged
Conversation
… the upload URL With s3_endpoint_url set, FileClient.upload rewrote the presigned URL's host and sent the request with the new one. SigV4 binds the Host header, so the S3 server answered 403 SignatureDoesNotMatch; LocalStack's skipped signature checks had hidden it. The connection now goes to the override while the request carries the Host the URL was signed for.
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
FileClient.uploadwiths3_endpoint_urlset rewrote the presigned upload URL's scheme and host and sent the PUT with the new host. SigV4 signs theHostheader, so the S3 server answered403 SignatureDoesNotMatch. LocalStack had skipped signature validation, which is why the override ever appeared to work; the dev stack's S3 server since RoboFinSystems/robosystems#2000 checks it, as AWS S3 does. The connection now goes to the override while the request carries theHostthe URL was signed for. Nothing changes when the option is unset.Reproduced against the dev stack with a SigV4 presigned PUT: host swapped → 403; host swapped with the signed
Hostheader → 200.Scope
Patch. The option keeps its name and meaning, so the stable tier is unchanged. No server release is needed; the fix works against any SigV4 endpoint. The option's comments and the clients README no longer describe it as a LocalStack switch.
Tests
Hostheader separately.Hostheader is set.Found during the supplyflow dev-stack migration, whose container-side catalog upload waits on this release.
🤖 Generated with Claude Code