diff --git a/lib/fir/cli.rb b/lib/fir/cli.rb index 5704eb9..c12aec9 100644 --- a/lib/fir/cli.rb +++ b/lib/fir/cli.rb @@ -144,9 +144,10 @@ def info(*args) method_option :auto_download_bundletool_jar, type: :boolean, default: false, desc: "upload aab file command: would download bundletool when invoke bundletool failure" method_option :save_uploaded_info, type: :boolean, default: false, desc: 'save uploaded info to local file named fir-cli-answer.json' + + method_option :user_download_file_name, type: :string, desc: 'set user download file name, (not support with params switch_to_qiniu)' def publish(*args) prepare :publish - FIR.publish(*args, options) end diff --git a/lib/fir/util/ali_uploader.rb b/lib/fir/util/ali_uploader.rb index bc0e544..a3d19d2 100644 --- a/lib/fir/util/ali_uploader.rb +++ b/lib/fir/util/ali_uploader.rb @@ -1,5 +1,6 @@ # frozen_string_literal: true +require 'uri' require_relative './app_uploader' @@ -39,6 +40,15 @@ def upload_binary 'authorization' => headers[:authorization] } + if @options[:user_download_file_name] != nil + # 处理中文问题, 使之支持 CONTENT-DISPOSITION 的要求 + + + headers_copy["CONTENT-DISPOSITION"] = "attachment; filename=#{URI.encode_www_form_component @options[:user_download_file_name]}" + + + end + logger.debug headers_copy put_file(binary_url, binary_info, headers_copy) callback_to_api(callback_url, callback_binary_information) diff --git a/lib/fir/version.rb b/lib/fir/version.rb index 58dedf1..16af956 100644 --- a/lib/fir/version.rb +++ b/lib/fir/version.rb @@ -1,5 +1,5 @@ # encoding: utf-8 module FIR - VERSION = "2.0.21" + VERSION = "2.0.22" end