diff --git a/lib/qiniu/tokens/upload_token.rb b/lib/qiniu/tokens/upload_token.rb index 0542762..5fb22b3 100755 --- a/lib/qiniu/tokens/upload_token.rb +++ b/lib/qiniu/tokens/upload_token.rb @@ -14,7 +14,7 @@ module Qiniu def initialize(opts = {}) @scope = opts[:scope] - @expires_in = opts[:expires_in] + @expires_in = opts[:expires_in] || 3600 @callback_url = opts[:callback_url] @callback_body_type = opts[:callback_body_type] @customer = opts[:customer] diff --git a/spec/qiniu/rs_spec.rb b/spec/qiniu/rs_spec.rb index 215b0b4..8f2a32a 100755 --- a/spec/qiniu/rs_spec.rb +++ b/spec/qiniu/rs_spec.rb @@ -115,7 +115,7 @@ module Qiniu context ".upload_file" do it "should works" do - uptoken_opts = {:scope => @bucket, :expires_in => 3600} + uptoken_opts = {:scope => @bucket} upload_opts = { :uptoken => Qiniu::RS.generate_upload_token(uptoken_opts), :file => __FILE__, diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb index bafee2d..78f5edc 100755 --- a/spec/spec_helper.rb +++ b/spec/spec_helper.rb @@ -8,7 +8,7 @@ RSpec.configure do |config| config.before :all do #=begin Qiniu::RS.establish_connection! :access_key => "3fPHl_SLkPXdioqI_A8_NGngPWVJhlDk2ktRjogH", - :secret_key => "bXTPMDJrVYRJUiSDRFtFYwycVD_mjXxYWrCYlDHy", + :secret_key => "bXTPMDJrVYRJUiSDRFtFYwycVD_mjXxYWrCYlDHy" #=end =begin Qiniu::RS.establish_connection! :access_key => "bE21M6FW9V7zAFrBY5psgKOKJQLiBj12qMWTpc57",