gitlab archive 接口如下:
# Get an archive of the repository
# @param [Integer] project the ID fo a project.
# sha (optional) - The commit SHA to download defaults to the tip of the default branch
# @return [Gitlab::ObjectifiedHash]
def project_archive(project, sha)
get("/projects/#{project}/repository/archive?sha=#{sha}")
end
alias_method :repo_project_archive, :project_archive
调用 archive 接口后,返回 [Gitlab::ObjectifiedHash] 类型,而我想直接 send file,有好的解决方法吗? 当然,如果使用:https://git.aaaaa.net/api/v3/projects/1/repository/archive?&private_token=XXXXXXXXXX 这样是可以直接下载,但是会暴漏 token 值
谢谢大家