You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It's not clear to me if this is a fog, rails or a carrierwave issue, but I'm starting here.
Carrierwave allows a user to set a fog_authenticated_url_expiration, which can be used to generate a X-Amz-Expires header when requesting an authenticated URL from S3. For example, fog_authenticated_url_expiration is set to 1.week (an ActiveRecord::Duration)
If this duration spans a transition on or off Daylight Savings Time, the wrong X-Amz-Expires header is generated.
See the patch below for a failing test
index c87068a..10a3071 100644
--- a/spec/storage/fog_helper.rb+++ b/spec/storage/fog_helper.rb@@ -85,6 +85,26 @@ end
end
end
+ it "should generate a proper X-Amz-Expires when expires spans a move to DST" do+ if @provider == 'AWS'+ Timecop.freeze(Time.at(1477932000)) do |now|+ expiration = 7 * 24 * 60 * 60 # 1 week+ allow(@uploader).to receive(:fog_authenticated_url_expiration).and_return(expiration)+ expect(@fog_file.authenticated_url).to include("X-Amz-Expires=#{expiration.to_s}")+ end+ end+ end++ pending "should generate a proper X-Amz-Expires when expires spans a move to DST and an ActiveRecord::Duration is provided" do+ if @provider == 'AWS'+ Timecop.freeze(Time.at(1477932000)) do |now|+ expiration = 1.week+ allow(@uploader).to receive(:fog_authenticated_url_expiration).and_return(expiration)+ expect(@fog_file.authenticated_url).to include("X-Amz-Expires=#{expiration.to_s}")+ end+ end+ end+
it "should use a subdomain URL for AWS if the directory is a valid subdomain" do
if @provider == 'AWS'
allow(@uploader).to receive(:fog_directory).and_return('assets.site.com')
The text was updated successfully, but these errors were encountered:
Hi -
It's not clear to me if this is a fog, rails or a carrierwave issue, but I'm starting here.
Carrierwave allows a user to set a
fog_authenticated_url_expiration
, which can be used to generate aX-Amz-Expires
header when requesting an authenticated URL from S3. For example,fog_authenticated_url_expiration
is set to1.week
(anActiveRecord::Duration
)If this duration spans a transition on or off Daylight Savings Time, the wrong
X-Amz-Expires
header is generated.See the patch below for a failing test
The text was updated successfully, but these errors were encountered: