Browse Source

fixed get_file ref空处理

pull/347/head
xxq250 1 year ago
parent
commit
17c8866d64
1 changed files with 2 additions and 1 deletions
  1. +2
    -1
      app/controllers/attachments_controller.rb

+ 2
- 1
app/controllers/attachments_controller.rb View File

@@ -49,7 +49,8 @@ class AttachmentsController < ApplicationController
url.gsub!(url.split("/")[-1], '')
Rails.logger.info("url===#{url}")
Rails.logger.info(filepath)
request_url = [domain, api_url, URI.encode(url), URI.escape(filepath), "?ref=#{URI.escape(ref.split('ref=')[1])}&access_token=#{User.where(admin: true).take&.gitea_token}"].join
ref = ref.blank? ? "" : URI.escape(ref.split('ref=')[1])
request_url = [domain, api_url, URI.encode(url), URI.escape(filepath), "?ref=#{ref}&access_token=#{User.where(admin: true).take&.gitea_token}"].join
Rails.logger.info("request_url===#{request_url}")
file = Util.download_file(request_url, tmp_path)
filename = filepath


Loading…
Cancel
Save