blob/gcsblob: return Unimplemented for EnforceAbsentContentType in SignedURL#3757
Closed
herdiyana256 wants to merge 1 commit into
Closed
blob/gcsblob: return Unimplemented for EnforceAbsentContentType in SignedURL#3757herdiyana256 wants to merge 1 commit into
herdiyana256 wants to merge 1 commit into
Conversation
…gnedURL driver.SignedURLOptions documents that a backend which cannot enforce an absent Content-Type on a signed PUT URL must return Unimplemented. s3blob and azureblob both do this. gcsblob had no check at all and silently returned a working signed URL that does not enforce it, since the GCS SDK's SignedURLOptions has no field for forbidding a header's presence.
Contributor
|
Are you sure about this? IIRC, there is a test that verifies this works; search for "putURLEnforcedAbsentContentType" in blob/drivertest/drivertest.go. |
Contributor
Author
|
You're right, thanks for pointing me at that test. I ran TestConformance/TestSignedURL against the unpatched code and the enforced-absent-content-type case already passes, the PUT with a mismatched Content-Type header does get rejected. I was going off the SignedURLOptions struct not exposing a way to express it and didn't check the existing conformance test first. Closing this, sorry for the noise. |
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.
driver.SignedURLOptions documents that a backend which cannot enforce an absent Content-Type on a signed PUT URL must return Unimplemented. s3blob and azureblob both do this. gcsblob had no check at all and silently returned a working signed URL that does not enforce it, since the GCS SDK's SignedURLOptions has no field for forbidding a header's presence.
Added the same check gcsblob's siblings already have, right after the existing signer-validation check in SignedURL.