-
Notifications
You must be signed in to change notification settings - Fork 862
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Can't set CacheControl header on S3 object when use AmazonS3Client.PutObject #1410
Comments
Hi @vachumakov, this appears to be the same issue as #823. I was able to reproduce your problem, and then I got it to work by adding the suggested space after the comma. We'll take another look at this problem so users don't have to worry about the space. |
Thanks @klaytaybai Handling the spaces issue on the AWS SDK side would be very helpful. |
Check this issue after fix for #1685 is implemented. |
Not fixed in latest version of AWSSDK.S3 (3.5.9.3) and AWSSDK.Core (3.5.3.5). Adding space after comma in The extra space appears to be added by .NET Core while adding headers to May be changing line at
set { this["Cache-Control"] = (value != null? value.Replace(",", ", ") : value); } could be the fix. But the change needs to be tested across .NET Framework/.NET Core versions.
|
We have noticed this issue has not received attention in 1 year. We will close this issue for now. If you think this is in error, please feel free to comment and reopen the issue. |
Do not close |
I know it's been a while, but this problem doesn't happen anymore in the latest version of the I tried running your original example and the |
Comments on closed issues are hard for our team to see. |
I tied to put object on S3 with CacheControl header has ',' character and got "The request signature we calculated does not match the signature you provided" exception.
Expected Behavior
It should be possible to put object on s3 with header CacheControl = "max-age=3600,s-maxage=60"
Current Behavior
If user puts value with "," character (for example: max-age=7200,s-maxage=60) to PutObjectRequest.Headers.CacheControl, unhandled exception appears:
Amazon.S3.AmazonS3Exception: The request signature we calculated does not match the signature you provided. Check your key and signing method
Steps to Reproduce (for bugs)
Here is my sample:
Context
I have S3 bucket. On the top of this bucket I have CloudFront and I want to control cloudfront cache behavior with a help of two http headers max-age and s-maxage
Your Environment
.NET Core Info
dotnet --info
:The text was updated successfully, but these errors were encountered: