From 8349a03e2cc998ac7b5740cbf457570e5d88d286 Mon Sep 17 00:00:00 2001 From: xxq250 Date: Fri, 24 Jul 2026 11:35:05 +0800 Subject: [PATCH] fixed sendfile user image --- app/controllers/users_controller.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/controllers/users_controller.rb b/app/controllers/users_controller.rb index 27bf13a8b..f79f95e15 100644 --- a/app/controllers/users_controller.rb +++ b/app/controllers/users_controller.rb @@ -238,7 +238,7 @@ class UsersController < ApplicationController def get_image return render_not_found unless @user = User.find_by(login: params[:id]) || User.find_by_id(params[:id]) # return render_forbidden unless User.current.logged? && (current_user&.admin? || current_user.id == @user.id) - send_file(Rails.root.join('public', url_to_avatar(@user).to_s), :type => 'application/octet-stream;charset=utf-8') + send_file(Rails.root.join('public', url_to_avatar(@user).to_s.split("?")[0]), :type => 'application/octet-stream;charset=utf-8') end def me