我的预签名下载 URL 有问题
using (var S3Client = new AmazonS3Client(AppSettings.AwsAccessKey, AppSettings.AwsSecretKey, Amazon.RegionEndpoint.USEast1))
{
GetPreSignedUrlRequest request = new GetPreSignedUrlRequest
{
BucketName = AppSettings.AwsS3BucketName,
Key = Filename,
Expires = DateTime.Now.AddSeconds(ExpirationSeconds),
Verb = HttpVerb.GET
};
return S3Client.GetPreSignedURL(request);
}
通常我会设置 10 到 30 秒的过期时间,然后突然我开始收到一条消息,指出我的 URL 已过期。
<Error>
<Code>AccessDenied</Code>
<Message>Request has expired</Message>
<Expires>2016-05-04T11:21:39Z</Expires>
<ServerTime>2016-05-04T11:22:12Z</ServerTime>
<RequestId>F329329970936A18</RequestId>
<HostId>womi/k5E9ffDDa6PffCcWBMYzUF2i4oRIY+QX6R/6v0IjQlipYA2OKBPQOflkoLIl4+wk6So7Ks=</HostId>
</Error>
日期差异太大。那有什么问题?