mirror of
https://gitlink.org.cn/Gitlink/forgeplus.git
synced 2026-05-24 13:45:44 +08:00
fixed gitea文件下载缓存,更改目录
This commit is contained in:
@@ -39,7 +39,7 @@ class AttachmentsController < ApplicationController
|
|||||||
value = Rails.cache.read(cache_key)
|
value = Rails.cache.read(cache_key)
|
||||||
if value.to_i >= 5 && File.exist?(tmp_path)
|
if value.to_i >= 5 && File.exist?(tmp_path)
|
||||||
filepath, ref = url.split("/")[-1].split("?")
|
filepath, ref = url.split("/")[-1].split("?")
|
||||||
send_data(tmp_path, filename: filepath, type: "application/octet-stream", disposition: 'attachment')
|
send_data(tmp_path, filename: filepath, stream:false, type: 'application/octet-stream')
|
||||||
else
|
else
|
||||||
if url.starts_with?(base_url) && !url.starts_with?("#{base_url}/repo")
|
if url.starts_with?(base_url) && !url.starts_with?("#{base_url}/repo")
|
||||||
domain = GiteaService.gitea_config[:domain]
|
domain = GiteaService.gitea_config[:domain]
|
||||||
|
|||||||
Reference in New Issue
Block a user