default not found image

This commit is contained in:
Dylan Knutson
2023-08-21 11:22:11 -07:00
parent ad78d41f06
commit 552532a95c
2 changed files with 6 additions and 2 deletions

View File

@@ -10,11 +10,12 @@ class BlobsController < ApplicationController
end
def contents
thumb = params[:thumb]
raise("invalid thumb #{thumb}") if !thumb.blank? && !thumb_params(thumb)
expires_dur = 1.year
response.headers["Expires"] = expires_dur.from_now.httpdate
expires_in expires_dur, public: true
thumb = params[:thumb]
raise("invalid thumb #{thumb}") if !thumb.blank? && !thumb_params(thumb)
sha256 = params[:id]
etag = sha256

View File

@@ -9,6 +9,9 @@ module Domain::Fa::UsersHelper
elsif (path = user.avatar&.guess_file_uri_from_hles)
path
end
rescue
# default / 'not found' avatar image
"/blobs/9080fd4e7e23920eb2dccfe2d86903fc3e748eebb2e5aa8c657bbf6f3d941cdc/contents.jpg"
end
def sanitized_fa_user_profile_html(html)